You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2016/03/10 05:27:13 UTC

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

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 <km...@apache.org>
Authored: Wed Mar 9 23:27:07 2016 -0500
Committer: Kevin Minder <km...@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();