[HtmlUnit] SVN: [13769] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ WebResponseTest.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [13769] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ WebResponseTest.java

asashour-2
Revision: 13769
          http://sourceforge.net/p/htmlunit/code/13769
Author:   asashour
Date:     2017-03-15 20:54:09 +0000 (Wed, 15 Mar 2017)
Log Message:
-----------
use new methods

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebResponseTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebResponseTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebResponseTest.java 2017-03-15 20:51:01 UTC (rev 13768)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebResponseTest.java 2017-03-15 20:54:09 UTC (rev 13769)
@@ -100,7 +100,7 @@
         assertEquals(title, page.getTitleText());
 
         assertEquals(content, page.getWebResponse().getContentAsString());
-        assertEquals(content, page.getWebResponse().getContentAsString("UTF-8"));
+        assertEquals(content, page.getWebResponse().getContentAsString(StandardCharsets.UTF_8));
     }
 
     /**
@@ -192,7 +192,8 @@
         webClient.setWebConnection(conn);
 
         final Page page = webClient.getPage(URL_FIRST);
-        assertEquals("<html/>", page.getWebResponse().getContentAsString("EUROPE"));
+        final WebResponse webResponse = page.getWebResponse();
+        assertEquals("<html/>", webResponse.getContentAsString(webResponse.getContentCharset()));
     }
 
     /**
@@ -235,7 +236,8 @@
         startWebServer("./", null, servlets);
 
         final HtmlPage page = getWebClient().getPage("http://localhost:" + PORT + "/test");
-        assertEquals(BinaryResponseHeadersServlet.RESPONSE, page.getWebResponse().getContentAsString("UTF8"));
+        assertEquals(BinaryResponseHeadersServlet.RESPONSE,
+                page.getWebResponse().getContentAsString(StandardCharsets.UTF_8));
 
         assertEquals("gzip", page.getWebResponse().getResponseHeaderValue("Content-Encoding"));
         assertEquals("73", page.getWebResponse().getResponseHeaderValue("Content-Length"));


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop