knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: [KNOX-685] - Knox tests cleanup after Jetty 9 upgrade. Potential charset reencoding text fix (KNOX-678).
Date Thu, 10 Mar 2016 04:27:13 GMT
Repository: knox
Updated Branches:
  refs/heads/master d98a80f2e -> a8b190dee


[KNOX-685] - Knox tests cleanup after Jetty 9 upgrade. Potential charset reencoding text fix
(KNOX-678).


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/a8b190de
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/a8b190de
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/a8b190de

Branch: refs/heads/master
Commit: a8b190deecd318f4109996a3205f97dc759730fb
Parents: d98a80f
Author: Kevin Minder <kminder@apache.org>
Authored: Wed Mar 9 23:27:07 2016 -0500
Committer: Kevin Minder <kminder@apache.org>
Committed: Wed Mar 9 23:27:07 2016 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/gateway/GatewayMultiFuncTest.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/a8b190de/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
index 7ae7c71..ca6fd43 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayMultiFuncTest.java
@@ -189,26 +189,28 @@ public class GatewayMultiFuncTest {
 
     mock.expect().method( "GET" )
         .respond().contentType( "application/json" ).contentLength( -1 ).content( "{\"msg\":\"H\u00eallo\"}",
Charset.forName( "UTF-8" ) );
-    given()
+    String json = given()
         //.log().all()
         .auth().preemptive().basic( uname, pword )
         .expect()
         //.log().all()
         .statusCode( HttpStatus.SC_OK )
-        .body( "msg", is( "H\u00eallo" ) )
-        .when().log().ifError().get( gatewayUrl + "/knox678/repeat" );
+        .contentType( "application/json; charset=UTF-8" )
+        .when().log().ifError().get( gatewayUrl + "/knox678/repeat" ).andReturn().asString();
+    assertThat( json, is("{\"msg\":\"H\u00eallo\"}") );
     assertThat( mock.isEmpty(), is(true) );
 
     mock.expect().method( "GET" )
         .respond().contentType( "application/octet-stream" ).contentLength( -1 ).content(
"H\u00eallo".getBytes() );
-    byte[] body = given()
+    byte[] bytes = given()
         //.log().all()
         .auth().preemptive().basic( uname, pword )
         .expect()
         //.log().all()
         .statusCode( HttpStatus.SC_OK )
+        .contentType( "application/octet-stream" )
         .when().log().ifError().get( gatewayUrl + "/knox678/repeat" ).andReturn().asByteArray();
-    assertThat( body, is(equalTo("H\u00eallo".getBytes())) );
+    assertThat( bytes, is(equalTo("H\u00eallo".getBytes())) );
     assertThat( mock.isEmpty(), is(true) );
 
     mock.stop();


Mime
View raw message