Repository: knox
Updated Branches:
  refs/heads/master e2e125146 -> aac2054c8


KNOX-1038 - Replace deprecated rest-assured "content" call with "body"


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

Branch: refs/heads/master
Commit: aac2054c83399669a7084dbb8452013f7e3b532c
Parents: e2e1251
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Thu Sep 14 10:12:58 2017 +0100
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Thu Sep 14 10:12:58 2017 +0100

----------------------------------------------------------------------
 .../gateway/GatewayAdminTopologyFuncTest.java   |   2 -
 .../hadoop/gateway/GatewayBasicFuncTest.java    | 125 +++++++++----------
 .../hadoop/gateway/GatewayHealthFuncTest.java   |   2 +-
 .../GatewayLdapDynamicGroupFuncTest.java        |   2 +-
 .../gateway/GatewayLdapPosixGroupFuncTest.java  |   9 --
 .../GatewayPortMappingDisableFeatureTest.java   |   2 +-
 .../gateway/GatewayPortMappingFuncTest.java     |   2 +-
 .../apache/hadoop/gateway/Knox242FuncTest.java  |   2 +-
 .../hadoop/gateway/WebHdfsHaFuncTest.java       |  10 +-
 9 files changed, 69 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
index 3a5cd84..2efddff 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminTopologyFuncTest.java
@@ -795,6 +795,4 @@ public class GatewayAdminTopologyFuncTest {
     LOG_EXIT();
   }
 
-  private static final String CLASS = 
GatewayAdminTopologyFuncTest.class.getCanonicalName();
-
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
index cbe12a8..472270c 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
@@ -314,7 +314,7 @@ public class GatewayBasicFuncTest {
         //.log().all()
         .statusCode( HttpStatus.SC_OK )
         .contentType( "application/json" )
-        .content( "boolean", is( true ) )
+        .body( "boolean", is( true ) )
         .when().put( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" 
).getDetailedCookie( "JSESSIONID" );
     assertThat( cookie.isSecured(), is( true ) );
     assertThat( cookie.isHttpOnly(), is( true ) );
@@ -373,9 +373,6 @@ public class GatewayBasicFuncTest {
     String root = "/tmp/GatewayBasicFuncTest/testBasicOutboundHeaderUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
-    InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
-    String gatewayHostName = gatewayAddress.getHostName();
-    String gatewayAddrName = 
InetAddress.getByName(gatewayHostName).getHostAddress();
 
     driver.getMock( "WEBHDFS" )
         .expect()
@@ -412,7 +409,6 @@ public class GatewayBasicFuncTest {
     String root = "/tmp/GatewayBasicFuncTest/testHdfsTildeUseCase";
     String username = "hdfs";
     String password = "hdfs-password";
-    InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
 
     // Attempt to delete the test directory in case a previous run failed.
     // Ignore any result.
@@ -462,7 +458,7 @@ public class GatewayBasicFuncTest {
           //.log().all();
           .statusCode( HttpStatus.SC_OK )
           .contentType( "application/json" )
-          .content( "boolean", is( true ) )
+          .body( "boolean", is( true ) )
           .when().put( driver.getUrl( "WEBHDFS" ) + "/v1/~/dir" );
       driver.assertComplete();
     } finally {
@@ -535,7 +531,7 @@ public class GatewayBasicFuncTest {
         //.log().all();
         .statusCode( HttpStatus.SC_OK )
         .contentType( "application/json" )
-        .content( "boolean", is( true ) )
+        .body( "boolean", is( true ) )
         .when().put( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" );
     driver.assertComplete();
 
@@ -557,7 +553,7 @@ public class GatewayBasicFuncTest {
         .expect()
         //.log().ifError()
         .statusCode( HttpStatus.SC_OK )
-        .content( "FileStatuses.FileStatus[0].pathSuffix", is( "dir" ) )
+        .body( "FileStatuses.FileStatus[0].pathSuffix", is( "dir" ) )
         .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root );
     driver.assertComplete();
 
@@ -658,7 +654,7 @@ public class GatewayBasicFuncTest {
         //.log().all()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( "test.txt" ) )
+        .body( driver.getResourceBytes( "test.txt" ) )
         .contentType( "text/plain" )
         .expect()
         //.log().ifError()
@@ -716,7 +712,7 @@ public class GatewayBasicFuncTest {
         .expect()
         //.log().ifError()
         .statusCode( HttpStatus.SC_OK )
-        .content( is( "TEST" ) )
+        .body( is( "TEST" ) )
         .when().get( driver.getUrl("WEBHDFS") + "/v1" + root + "/dir/file" );
     driver.assertComplete();
 
@@ -875,7 +871,6 @@ public class GatewayBasicFuncTest {
     String root = "/tmp/GatewayBasicFuncTest/testJavaMapReduceViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
-    String group = "mapred";
 //    String user = "hcat";
 //    String pass = "hcat-password";
 //    String group = "hcat";
@@ -1063,10 +1058,8 @@ public class GatewayBasicFuncTest {
   @Test( timeout = TestUtils.MEDIUM_TIMEOUT )
   public void testBasicHiveJDBCUseCase() throws IOException {
     LOG_ENTER();
-    String root = "/tmp/GatewayHiveJDBCFuncTest/testBasicHiveUseCase";
     String username = "hive";
     String password = "hive-password";
-    InetSocketAddress gatewayAddress = driver.gateway.getAddresses()[0];
 
     // This use case emulates simple JDBC scenario which consists of following 
steps:
     // -open connection;
@@ -1090,7 +1083,7 @@ public class GatewayBasicFuncTest {
     Response response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( "hive/open-session-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/open-session-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1115,7 +1108,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-set-fetch-output-serde-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-set-fetch-output-serde-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1139,7 +1132,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-1-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-1-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1163,7 +1156,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-set-server2-http-path-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-set-server2-http-path-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1187,7 +1180,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-2-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-2-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1211,7 +1204,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-set-server2-servermode-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-set-server2-servermode-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1235,7 +1228,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-3-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-3-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1259,7 +1252,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-set-security-authorization-enabled-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-set-security-authorization-enabled-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1283,7 +1276,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-4-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-4-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1307,7 +1300,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-create-table-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-create-table-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1331,7 +1324,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-5-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-5-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1355,7 +1348,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/execute-select-from-table-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/execute-select-from-table-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1379,7 +1372,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/get-result-set-metadata-request.bin" ) )
+        .body( driver.getResourceBytes( 
"hive/get-result-set-metadata-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1403,7 +1396,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( "hive/fetch-results-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/fetch-results-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1427,7 +1420,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( 
"hive/close-operation-6-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-operation-6-request.bin" ) 
)
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1451,7 +1444,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic( username, password )
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content( driver.getResourceBytes( "hive/close-session-request.bin" ) )
+        .body( driver.getResourceBytes( "hive/close-session-request.bin" ) )
         .contentType( "application/x-thrift" )
         .expect()
         .statusCode( HttpStatus.SC_OK )
@@ -1535,7 +1528,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( "application/x-protobuf" )
-    .content( is( driver.getResourceString( resourceName + ".protobuf", UTF8 ) 
) )
+    .body( is( driver.getResourceString( resourceName + ".protobuf", UTF8 ) ) )
     .when().get( driver.getUrl( "WEBHBASE" ) );
     driver.assertComplete();
     LOG_EXIT();
@@ -1719,7 +1712,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .header("X-XSRF-Header", "jksdhfkhdsf")
     //.header( "Content-Type", ContentType.XML.toString() )
-    .content( driver.getResourceBytes( resourceName + ".xml" ) )
+    .body( driver.getResourceBytes( resourceName + ".xml" ) )
     .contentType( ContentType.XML.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
@@ -1739,7 +1732,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .header("X-XSRF-Header", "jksdhfkhdsf")
     //.header( "Content-Type", ContentType.JSON.toString() )
-    .content( driver.getResourceBytes( resourceName + ".json" ) )
+    .body( driver.getResourceBytes( resourceName + ".json" ) )
     .contentType( ContentType.JSON.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
@@ -1760,7 +1753,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .header("X-XSRF-Header", "jksdhfkhdsf")
     //.header( "Content-Type", "application/x-protobuf" )
-    .content( driver.getResourceBytes( resourceName + ".protobuf" ) )
+    .body( driver.getResourceBytes( resourceName + ".protobuf" ) )
     .contentType( "application/x-protobuf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
@@ -1783,7 +1776,7 @@ public class GatewayBasicFuncTest {
       .auth().preemptive().basic( username, password )
       .header("X-XSRF-Header", "jksdhfkhdsf")
       //.header( "Content-Type", ContentType.XML.toString() )
-      .content( driver.getResourceBytes( resourceName + ".xml" ) )
+      .body( driver.getResourceBytes( resourceName + ".xml" ) )
       .contentType( ContentType.XML.toString() )
       .expect()
       .statusCode( HttpStatus.SC_OK )
@@ -1803,7 +1796,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .header("X-XSRF-Header", "jksdhfkhdsf")
     //.header( "Content-Type", ContentType.JSON.toString() )
-    .content( driver.getResourceBytes( resourceName + ".json" ) )
+    .body( driver.getResourceBytes( resourceName + ".json" ) )
     .contentType( ContentType.JSON.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
@@ -1824,7 +1817,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .header("X-XSRF-Header", "jksdhfkhdsf")
     //.header( "Content-Type", "application/x-protobuf" )
-    .content( driver.getResourceBytes( resourceName + ".protobuf" ) )
+    .body( driver.getResourceBytes( resourceName + ".protobuf" ) )
     .contentType( "application/x-protobuf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
@@ -2241,17 +2234,17 @@ public class GatewayBasicFuncTest {
 //         .log().all()
         .statusCode( HttpStatus.SC_OK )
         .contentType( contentType )
-        .content( "apps.app[0].trackingUrl", isEmptyString() )
-        .content( "apps.app[1].trackingUrl",
+        .body( "apps.app[0].trackingUrl", isEmptyString() )
+        .body( "apps.app[1].trackingUrl",
             anyOf(
                 startsWith( "http://"; + gatewayHostName + ":" + 
gatewayAddress.getPort() + "/" ),
                 startsWith( "http://"; + gatewayAddrName + ":" + 
gatewayAddress.getPort() + "/" ) ) )
-        .content( "apps.app[2].trackingUrl", isEmptyString() )
-        .content( "apps.app[0].amContainerLogs", isEmptyString() )
-        .content( "apps.app[1].amContainerLogs", isEmptyString() )
-        .content( "apps.app[0].amHostHttpAddress", isEmptyString() )
-        .content( "apps.app[1].amHostHttpAddress", isEmptyString() )
-        .content( "apps.app[2].id", is( "application_1399541193872_0009" ) )
+        .body( "apps.app[2].trackingUrl", isEmptyString() )
+        .body( "apps.app[0].amContainerLogs", isEmptyString() )
+        .body( "apps.app[1].amContainerLogs", isEmptyString() )
+        .body( "apps.app[0].amHostHttpAddress", isEmptyString() )
+        .body( "apps.app[1].amHostHttpAddress", isEmptyString() )
+        .body( "apps.app[2].id", is( "application_1399541193872_0009" ) )
         .when()
         .get(gatewayPath + gatewayPathQuery);
 
@@ -2296,7 +2289,7 @@ public class GatewayBasicFuncTest {
     given()
         .auth().preemptive().basic(username, password)
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content(driver.getResourceBytes(resource))
+        .body(driver.getResourceBytes(resource))
         .contentType("application/json")
         .expect()
         .statusCode(HttpStatus.SC_OK)
@@ -2318,7 +2311,7 @@ public class GatewayBasicFuncTest {
     response = given()
         .auth().preemptive().basic(username, password)
         .header("X-XSRF-Header", "jksdhfkhdsf")
-        .content(driver.getResourceBytes(resource))
+        .body(driver.getResourceBytes(resource))
         .contentType("application/json")
         .expect()
         .statusCode(HttpStatus.SC_OK)
@@ -2396,17 +2389,17 @@ public class GatewayBasicFuncTest {
         .statusCode( HttpStatus.SC_OK )
         .contentType( contentType );
     if ( running ) {
-      response.content(
+      response.body(
           "app.trackingUrl",
           anyOf(
               startsWith( "http://"; + gatewayHostName + ":" + 
gatewayAddress.getPort() + "/" ),
               startsWith( "http://"; + gatewayAddrName + ":" + 
gatewayAddress.getPort() + "/" ) ) );
     } else {
-      response.content( "app.trackingUrl", isEmptyString() );
+      response.body( "app.trackingUrl", isEmptyString() );
     }
 
-    response.content( "app.amContainerLogs", isEmptyString() )
-        .content( "app.amHostHttpAddress", isEmptyString() )
+    response.body( "app.amContainerLogs", isEmptyString() )
+        .body( "app.amHostHttpAddress", isEmptyString() )
         .when()
         .get( gatewayPath );
 
@@ -2508,9 +2501,9 @@ public class GatewayBasicFuncTest {
 //         .log().all()
         .statusCode( HttpStatus.SC_OK )
         .contentType( contentType )
-        .content( "appAttempts.appAttempt[0].nodeHttpAddress", isEmptyString() 
)
-        .content( "appAttempts.appAttempt[0].nodeId", not( containsString( 
"localhost:50060" ) ) )
-        .content( "appAttempts.appAttempt[0].logsLink", isEmptyString() )
+        .body( "appAttempts.appAttempt[0].nodeHttpAddress", isEmptyString() )
+        .body( "appAttempts.appAttempt[0].nodeId", not( containsString( 
"localhost:50060" ) ) )
+        .body( "appAttempts.appAttempt[0].logsLink", isEmptyString() )
         .when()
         .get( gatewayPath );
 
@@ -2573,9 +2566,9 @@ public class GatewayBasicFuncTest {
 //         .log().all()
         .statusCode( HttpStatus.SC_OK )
         .contentType( contentType )
-        .content( "nodes.node[0].id", not( containsString( nodeId ) ) )
-        .content( "nodes.node[0].nodeHostName", isEmptyString() )
-        .content( "nodes.node[0].nodeHTTPAddress", isEmptyString() )
+        .body( "nodes.node[0].id", not( containsString( nodeId ) ) )
+        .body( "nodes.node[0].nodeHostName", isEmptyString() )
+        .body( "nodes.node[0].nodeHTTPAddress", isEmptyString() )
         .when()
         .get( gatewayPath + gatewayPathQuery ).getBody().path( 
"nodes.node[0].id" );
 
@@ -2597,9 +2590,9 @@ public class GatewayBasicFuncTest {
 //         .log().all()
         .statusCode( HttpStatus.SC_OK )
         .contentType( contentType )
-        .content( "node.id", not( containsString( nodeId ) ) )
-        .content( "node.nodeHostName", isEmptyString() )
-        .content( "node.nodeHTTPAddress", isEmptyString() )
+        .body( "node.id", not( containsString( nodeId ) ) )
+        .body( "node.nodeHostName", isEmptyString() )
+        .body( "node.nodeHTTPAddress", isEmptyString() )
         .when()
         .get( gatewayPath + encryptedNodeId );
 
@@ -2798,7 +2791,7 @@ public class GatewayBasicFuncTest {
 
     if ( contentMatchers != null ) {
       for ( Entry<String, Matcher<?>> matcher : contentMatchers.entrySet() ) {
-        responseSpecification.content( matcher.getKey(), matcher.getValue() );
+        responseSpecification.body( matcher.getKey(), matcher.getValue() );
       }
     }
 
@@ -3156,7 +3149,7 @@ public class GatewayBasicFuncTest {
           .auth().preemptive().basic(username, password)
           .header("X-XSRF-Header", "jksdhfkhdsf")
           .header("Accept", contentType.toString())
-          .content(driver.getResourceBytes(postResource))
+          .body(driver.getResourceBytes(postResource))
           .expect()
           .statusCode(HttpStatus.SC_OK)
           .contentType(contentType.toString())
@@ -3890,7 +3883,7 @@ public class GatewayBasicFuncTest {
         .auth().preemptive().basic( user, password )
         .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .contentType( contentType )
-        .content( driver.getResourceBytes( resource ) )
+        .body( driver.getResourceBytes( resource ) )
         .expect()
         //.log().all()
         .statusCode( status )
@@ -4049,7 +4042,7 @@ public class GatewayBasicFuncTest {
         .header( "X-XSRF-Header", "jksdhfkhdsf" )
         .queryParam( "op", "CREATE" )
         .queryParam( "overwrite", "true" )
-        .content( driver.getResourceBytes( resource ) )
+        .body( driver.getResourceBytes( resource ) )
         .expect()
         //.log().all()
         .statusCode( status )
@@ -4091,7 +4084,7 @@ public class GatewayBasicFuncTest {
         .queryParam( "op", "CREATE" )
         .queryParam( "overwrite", "true" )
         .contentType( contentType )
-        .content( driver.getResourceBytes( resource ) )
+        .body( driver.getResourceBytes( resource ) )
         .expect()
         //.log().all()
         .statusCode( status )
@@ -4143,7 +4136,7 @@ public class GatewayBasicFuncTest {
         //.log().all()
         .statusCode( status )
         .contentType( "application/json" )
-        .content( "boolean", CoreMatchers.equalTo(true) )
+        .body( "boolean", CoreMatchers.equalTo(true) )
         .when()
         .put( driver.getUrl("WEBHDFS") + "/v1" + dir + ( driver.isUseGateway() 
? "" : "?user.name=" + user ) );
     String location = response.getHeader( "Location" );
@@ -4273,7 +4266,7 @@ public class GatewayBasicFuncTest {
         .pathParam( "job", job )
         .expect()
         //.log().all()
-        .content( "status.jobId", CoreMatchers.equalTo(job) )
+        .body( "status.jobId", CoreMatchers.equalTo(job) )
         .statusCode( HttpStatus.SC_OK )
         .when().get( driver.getUrl( "WEBHCAT" ) + "/v1/jobs/{job}" + ( 
driver.isUseGateway() ? "" : "?user.name=" + user ) ).asString();
     log.debug( "STATUS=" + status );

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayHealthFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayHealthFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayHealthFuncTest.java
index 84d43b8..033f028 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayHealthFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayHealthFuncTest.java
@@ -194,7 +194,7 @@ public class GatewayHealthFuncTest {
         .statusCode(HttpStatus.SC_OK)
         .contentType(MediaType.APPLICATION_JSON)
         .when().get(serviceUrl).asString();
-    String version = JsonPath.from(body).getString("version");
+    //String version = JsonPath.from(body).getString("version");
     Map<String, String> hm = JsonPath.from(body).getMap("");
     Assert.assertTrue(hm.size() >= 6);
     Assert.assertTrue(hm.keySet().containsAll(new 
HashSet<String>(Arrays.asList(new String[]{"timers", "histograms",

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
index 5567321..49ae6ed 100755
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapDynamicGroupFuncTest.java
@@ -155,7 +155,7 @@ public class GatewayLdapDynamicGroupFuncTest {
     AliasService aliasService = 
(AliasService)services.getService(GatewayServices.ALIAS_SERVICE);
     aliasService.addAliasForCluster("testdg-cluster", "ldcSystemPassword", 
"guest-password");
 
-    char[] password1 = aliasService.getPasswordFromAliasForCluster( 
"testdg-cluster", "ldcSystemPassword");
+    //char[] password1 = aliasService.getPasswordFromAliasForCluster( 
"testdg-cluster", "ldcSystemPassword");
     //System.err.println("SETUP password 10: " + ((password1 == null) ? "NULL" 
: new String(password1)));
 
     File descriptor = new File( topoDir, "testdg-cluster.xml" );

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
index 42674e8..f0b9fd0 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapPosixGroupFuncTest.java
@@ -61,7 +61,6 @@ import static org.hamcrest.CoreMatchers.notNullValue;
 @Category(ReleaseTest.class)
 public class GatewayLdapPosixGroupFuncTest {
 
-  private static final Class<?> RESOURCE_BASE_CLASS = 
GatewayLdapPosixGroupFuncTest.class;
   private static Logger LOG = LoggerFactory.getLogger( 
GatewayLdapPosixGroupFuncTest.class );
 
   public static Enumeration<Appender> appenders;
@@ -221,14 +220,6 @@ public class GatewayLdapPosixGroupFuncTest {
     return xml;
   }
 
-  private static String getResourceName( String resource ) {
-    return getResourceBaseName() + resource;
-  }
-
-  private static String getResourceBaseName() {
-    return RESOURCE_BASE_CLASS.getName().replaceAll( "\\.", "/" ) + "/";
-  }
-
   @Ignore
   // @Test
   public void waitForManualTesting() throws IOException {

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingDisableFeatureTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingDisableFeatureTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingDisableFeatureTest.java
index f5b6f78..848daa5 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingDisableFeatureTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingDisableFeatureTest.java
@@ -163,7 +163,7 @@ public class GatewayPortMappingDisableFeatureTest {
         .expect()
         .log().ifError()
         .statusCode(HttpStatus.SC_OK)
-        .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
+        .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
         .when().get(url + "/v1/");
     masterServer.isEmpty();
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFuncTest.java
 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFuncTest.java
index a8199d1..3e09730 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFuncTest.java
@@ -187,7 +187,7 @@ public class GatewayPortMappingFuncTest {
         .expect()
         .log().ifError()
         .statusCode(HttpStatus.SC_OK)
-        .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
+        .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
         .when().get(url + "/v1/");
     masterServer.isEmpty();
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
index 7026407..a7465d1 100755
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/Knox242FuncTest.java
@@ -135,7 +135,7 @@ public class Knox242FuncTest {
     AliasService aliasService = 
(AliasService)services.getService(GatewayServices.ALIAS_SERVICE);
     aliasService.addAliasForCluster("testdg-cluster", "ldcSystemPassword", 
"guest-password");
 
-    char[] password1 = aliasService.getPasswordFromAliasForCluster( 
"testdg-cluster", "ldcSystemPassword");
+    // char[] password1 = aliasService.getPasswordFromAliasForCluster( 
"testdg-cluster", "ldcSystemPassword");
     //System.err.println("SETUP password 10: " + ((password1 == null) ? "NULL" 
: new String(password1)));
 
     File descriptor = new File( topoDir, "testdg-cluster.xml" );

http://git-wip-us.apache.org/repos/asf/knox/blob/aac2054c/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
----------------------------------------------------------------------
diff --git 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
index 2f4574f..1fc8c33 100644
--- 
a/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
+++ 
b/gateway-test/src/test/java/org/apache/hadoop/gateway/WebHdfsHaFuncTest.java
@@ -174,7 +174,7 @@ public class WebHdfsHaFuncTest {
             .expect()
             .log().ifError()
             .statusCode(HttpStatus.SC_OK)
-            .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
+            .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       masterServer.isEmpty();
       LOG_EXIT();
@@ -204,7 +204,7 @@ public class WebHdfsHaFuncTest {
             .expect()
             .log().ifError()
             .statusCode(HttpStatus.SC_OK)
-            .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
+            .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       standbyServer.isEmpty();
       masterServer.start();
@@ -266,7 +266,7 @@ public class WebHdfsHaFuncTest {
             .expect()
             .log().ifError()
             .statusCode(HttpStatus.SC_OK)
-            .content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
+            .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs"))
             .when().get(driver.getUrl("WEBHDFS") + "/v1/");
       masterServer.isEmpty();
       standbyServer.isEmpty();
@@ -362,7 +362,7 @@ public class WebHdfsHaFuncTest {
             .expect()
             .log().ifError()
             .statusCode(HttpStatus.SC_OK)
-            .content("boolean", is(true))
+            .body("boolean", is(true))
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/foo.txt");
       masterServer.isEmpty();
       LOG_EXIT();
@@ -399,7 +399,7 @@ public class WebHdfsHaFuncTest {
             .expect()
             .log().ifError()
             .statusCode(HttpStatus.SC_OK)
-            .content("boolean", is(true))
+            .body("boolean", is(true))
             .when().post(driver.getUrl("WEBHDFS") + "/v1/user/hdfs/new");
       masterServer.isEmpty();
       LOG_EXIT();

Reply via email to