KNOX-1044 - Change Rest Assured "expect" to "then"
Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/4978951c Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/4978951c Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/4978951c Branch: refs/heads/master Commit: 4978951cc14bd63db2eace832b4db5544b80bee0 Parents: aac2054 Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Fri Sep 15 10:02:47 2017 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Fri Sep 15 10:02:47 2017 +0100 ---------------------------------------------------------------------- .../gateway/AmbariServiceDefinitionTest.java | 14 +- .../hadoop/gateway/GatewayAdminFuncTest.java | 2 +- .../gateway/GatewayAdminTopologyFuncTest.java | 60 ++--- .../hadoop/gateway/GatewayAppFuncTest.java | 68 +++--- .../hadoop/gateway/GatewayBasicFuncTest.java | 224 +++++++++---------- .../hadoop/gateway/GatewayDeployFuncTest.java | 2 +- .../hadoop/gateway/GatewayHealthFuncTest.java | 4 +- .../GatewayLdapDynamicGroupFuncTest.java | 4 +- .../gateway/GatewayLdapGroupFuncTest.java | 4 +- .../gateway/GatewayLdapPosixGroupFuncTest.java | 4 +- .../gateway/GatewayLocalServiceFuncTest.java | 2 +- .../hadoop/gateway/GatewayMultiFuncTest.java | 26 +-- .../GatewayPortMappingDisableFeatureTest.java | 2 +- .../gateway/GatewayPortMappingFailTest.java | 2 +- .../gateway/GatewayPortMappingFuncTest.java | 2 +- .../hadoop/gateway/GatewaySampleFuncTest.java | 2 +- .../apache/hadoop/gateway/Knox242FuncTest.java | 4 +- .../hadoop/gateway/WebHdfsHaFuncTest.java | 20 +- 18 files changed, 223 insertions(+), 223 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java index 2d02966..84b3ad3 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/AmbariServiceDefinitionTest.java @@ -177,7 +177,7 @@ public class AmbariServiceDefinitionTest { String body = given() // .log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -212,7 +212,7 @@ public class AmbariServiceDefinitionTest { String body = given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) .when().get( serviceUrl ).asString(); @@ -247,7 +247,7 @@ public class AmbariServiceDefinitionTest { given() .auth().preemptive().basic( username, password ) .queryParam("ServiceComponentInfo/component_name", "APP_TIMELINE_SERVER|ServiceComponentInfo/category=MASTER") - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) .when().get( serviceUrl ).asString(); @@ -274,7 +274,7 @@ public class AmbariServiceDefinitionTest { String body = given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) .when().get( serviceUrl ).asString(); @@ -302,8 +302,8 @@ public class AmbariServiceDefinitionTest { String body = given() .auth().preemptive().basic( username, password ) - .content(IOUtils.toByteArray(TestUtils.getResourceStream( DAT, "post-data-wrong-type.json"))) - .expect() + .body(IOUtils.toByteArray(TestUtils.getResourceStream( DAT, "post-data-wrong-type.json"))) + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "application/x-www-form-urlencoded" ) .when().post( serviceUrl ).asString(); @@ -335,7 +335,7 @@ public class AmbariServiceDefinitionTest { String body = given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) .when().get( serviceUrl ).asString(); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java index ca36248..342e9ca 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAdminFuncTest.java @@ -164,7 +164,7 @@ public class GatewayAdminFuncTest { //.log().all() .auth().preemptive().basic( username, password ) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) //.body( is( "{\"hash\":\"unknown\",\"version\":\"unknown\"}" ) ) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 2efddff..9ddc469 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 @@ -246,7 +246,7 @@ public class GatewayAdminTopologyFuncTest { .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .body("topologies.topology[0].name", not(nullValue())) @@ -263,7 +263,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() //.log().all() .body("topologies.topology.href[1]", equalTo(href1)) .statusCode(HttpStatus.SC_OK) @@ -273,7 +273,7 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() .auth().preemptive().basic(username, password) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_XML) @@ -282,7 +282,7 @@ public class GatewayAdminTopologyFuncTest { given().auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType("application/json") @@ -303,7 +303,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .when().get(serviceUrl).thenReturn().getBody().path("topologies.topology[1].href"); @@ -312,7 +312,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType("application/json") @@ -323,7 +323,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .body("topology.name", equalTo("test-cluster")) @@ -336,7 +336,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .when().get(serviceUrl).thenReturn().getBody().path("topologies.topology[1].href"); @@ -345,7 +345,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .when() @@ -366,7 +366,7 @@ public class GatewayAdminTopologyFuncTest { //.log().all() .auth().preemptive().basic(adminUser, adminPass) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType(ContentType.JSON) @@ -394,7 +394,7 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() .auth().basic(guestUser, guestPass) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_FORBIDDEN) .when().get(url); @@ -486,13 +486,13 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() - .auth().preemptive().basic( "admin", "admin-password" ).header( "Accept", MediaType.APPLICATION_JSON ).expect() + .auth().preemptive().basic( "admin", "admin-password" ).header( "Accept", MediaType.APPLICATION_JSON ).then() //.log().all() .statusCode( HttpStatus.SC_OK ).body( containsString( "ServerVersion" ) ).when().get( gatewayUrl + "/admin/api/v1/version" ); given() //.log().all() - .auth().preemptive().basic( user, password ).expect() + .auth().preemptive().basic( user, password ).then() //.log().all() .statusCode( HttpStatus.SC_NOT_FOUND ).when().get( url ); @@ -500,7 +500,7 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() - .auth().preemptive().basic( user, password ).expect() + .auth().preemptive().basic( user, password ).then() //.log().all() .statusCode( HttpStatus.SC_OK ).contentType( "text/plain" ).body( is( "test-service-response" ) ).when().get( url ).getBody(); @@ -508,7 +508,7 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() - .auth().preemptive().basic( user, password ).expect() + .auth().preemptive().basic( user, password ).then() //.log().all() .statusCode( HttpStatus.SC_NOT_FOUND ).when().get( url ); } finally { @@ -537,7 +537,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) @@ -545,7 +545,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) @@ -554,7 +554,7 @@ public class GatewayAdminTopologyFuncTest { given() //.log().all() .auth().preemptive().basic(username, password) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_NO_CONTENT) .when().get(url); @@ -583,7 +583,7 @@ public class GatewayAdminTopologyFuncTest { .contentType(MediaType.APPLICATION_JSON) .header("Accept", MediaType.APPLICATION_XML) .body(JsonPut) - .expect() + .then() .statusCode(HttpStatus.SC_OK) //.log().all() .when().put(url).getBody().asString(); @@ -597,7 +597,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(equalTo(XML)) .when().get(url) @@ -616,7 +616,7 @@ public class GatewayAdminTopologyFuncTest { .contentType(MediaType.APPLICATION_XML) .header("Accept", MediaType.APPLICATION_JSON) .body(XmlPut) - .expect() + .then() .statusCode(HttpStatus.SC_OK) //.log().all() .when().put(url).getBody().asString(); @@ -624,7 +624,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_JSON) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(equalTo(JSON)) .when().get(url) @@ -659,7 +659,7 @@ public class GatewayAdminTopologyFuncTest { .header("X-Forwarded-Server", server ) .header("X-Forwarded-Context", context) .header("X-Forwarded-Proto", proto) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(newUrl)) .body(containsString("test-cluster")) @@ -675,7 +675,7 @@ public class GatewayAdminTopologyFuncTest { .header("X-Forwarded-Server", server ) .header("X-Forwarded-Context", context ) .header("X-Forwarded-Proto", proto ) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(server)) .body(containsString(context)) @@ -693,7 +693,7 @@ public class GatewayAdminTopologyFuncTest { .header("X-Forwarded-Port", port ) .header("X-Forwarded-Context", context ) .header("X-Forwarded-Proto", proto) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(host)) .body(containsString(port)) @@ -711,7 +711,7 @@ public class GatewayAdminTopologyFuncTest { .header("X-Forwarded-Port", port) .header("X-Forwarded-Context", context) .header("X-Forwarded-Proto", proto) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(server)) .body(containsString(port)) @@ -727,7 +727,7 @@ public class GatewayAdminTopologyFuncTest { .header("Accept", MediaType.APPLICATION_XML) .header("X-Forwarded-Host", host ) .header("X-Forwarded-Port", port ) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(host)) .body(containsString(port)) @@ -739,7 +739,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(url)) .body(containsString("test-cluster")) @@ -760,7 +760,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(url + "/test-cluster")) .when().get(url); @@ -779,7 +779,7 @@ public class GatewayAdminTopologyFuncTest { given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.APPLICATION_XML) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .body(containsString(newUrl + "/test-cluster")) .when().get(newUrl); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java index ed44d15..b65575e 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayAppFuncTest.java @@ -180,7 +180,7 @@ public class GatewayAppFuncTest { String body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/html" ) @@ -191,7 +191,7 @@ public class GatewayAppFuncTest { body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/html" ) @@ -202,7 +202,7 @@ public class GatewayAppFuncTest { body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/html" ) @@ -214,7 +214,7 @@ public class GatewayAppFuncTest { given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( serviceUrl ); @@ -237,7 +237,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -248,7 +248,7 @@ public class GatewayAppFuncTest { given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when() .get( clusterUrl + "/dynamic-app-path" ); @@ -268,7 +268,7 @@ public class GatewayAppFuncTest { given() //.log().all() - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( gatewayUrl + "/test-topology/dynamic-app/?null" ) ) @@ -293,7 +293,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app/?null" ) ) @@ -304,7 +304,7 @@ public class GatewayAppFuncTest { given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when() .get( clusterUrl + "/dynamic-app" ); @@ -331,7 +331,7 @@ public class GatewayAppFuncTest { String body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/html" ) @@ -341,7 +341,7 @@ public class GatewayAppFuncTest { body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() .contentType( "" ) //.log().all() .statusCode( HttpStatus.SC_OK ) @@ -351,7 +351,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -360,7 +360,7 @@ public class GatewayAppFuncTest { body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() .contentType( "application/xml" ) //.log().all() .statusCode( HttpStatus.SC_OK ) @@ -372,22 +372,22 @@ public class GatewayAppFuncTest { given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/static-hello-app-path/index.html" ); given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/static-json-app/one.json" ); given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/dynamic-app-path" ); given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/test.xml" ); @@ -420,7 +420,7 @@ public class GatewayAppFuncTest { //.log().all() .auth().preemptive().basic( username, password ) .queryParam( "op", "GETHOMEDIRECTORY" ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "application/json" ) @@ -431,7 +431,7 @@ public class GatewayAppFuncTest { String body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "application/xml" ) @@ -441,7 +441,7 @@ public class GatewayAppFuncTest { body = given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() .contentType( "" ) //.log().all() .statusCode( HttpStatus.SC_OK ) @@ -453,17 +453,17 @@ public class GatewayAppFuncTest { given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/app-one/index.html" ); given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/app-two/one.json" ); given() .auth().preemptive().basic( username, password ) - .expect() + .then() .statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( clusterUrl + "/test.xml" ); @@ -499,7 +499,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -516,7 +516,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -533,7 +533,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -573,7 +573,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) @@ -582,7 +582,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) .when().get( clusterUrl + "/dynamic-app-path" ); @@ -596,7 +596,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( gatewayUrl + "/test-topology" + "/dynamic-app-path/?null" ) ) @@ -605,7 +605,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( gatewayUrl + "/test-topology-2" + "/dynamic-app-path/?null" ) ) @@ -614,7 +614,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_NOT_FOUND ) .body( is( clusterUrl + "/dynamic-app-path/?null" ) ); @@ -626,7 +626,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( gatewayUrl + "/test-topology" + "/dynamic-app-path/?null" ) ) @@ -635,7 +635,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .body( is( gatewayUrl + "/test-topology-2" + "/dynamic-app-path/?null" ) ) @@ -644,7 +644,7 @@ public class GatewayAppFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .body( is( clusterUrl + "/dynamic-app-path/?null" ) ) .when().get( clusterUrl + "/dynamic-app-path" ); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 472270c..7fadb74 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 @@ -310,7 +310,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "MKDIRS" ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "application/json" ) @@ -349,7 +349,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "CREATE" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_TEMPORARY_REDIRECT ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + root + "/dir/file" ); @@ -389,7 +389,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "CREATE" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_TEMPORARY_REDIRECT ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + root + "/dir/fileã¬ãã¼" ); @@ -433,7 +433,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "DELETE" ) .queryParam( "recursive", "true" ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .when().delete( driver.getUrl( "WEBHDFS" ) + "/v1/~" + root + ( driver.isUseGateway() ? "" : "?user.name=" + username ) ); @@ -454,7 +454,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "MKDIRS" ) - .expect() + .then() //.log().all(); .statusCode( HttpStatus.SC_OK ) .contentType( "application/json" ) @@ -496,7 +496,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "DELETE" ) .queryParam( "recursive", "true" ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .when().delete( driver.getUrl( "WEBHDFS" ) + "/v1" + root + ( driver.isUseGateway() ? "" : "?user.name=" + username ) ); @@ -527,7 +527,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "MKDIRS" ) - .expect() + .then() //.log().all(); .statusCode( HttpStatus.SC_OK ) .contentType( "application/json" ) @@ -550,7 +550,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "LISTSTATUS" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_OK ) .body( "FileStatuses.FileStatus[0].pathSuffix", is( "dir" ) ) @@ -563,7 +563,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, "invalid-password" ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "LISTSTATUS" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root ); @@ -575,7 +575,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( "hdfs-user", "hdfs-password" ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "LISTSTATUS" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root ); @@ -587,7 +587,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( "mapred-user", "mapred-password" ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "LISTSTATUS" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root ); @@ -597,12 +597,12 @@ public class GatewayBasicFuncTest { [&overwrite=<true|false>][&blocksize=<LONG>][&replication=<SHORT>] [&permission=<OCTAL>][&buffersize=<INT>]" - The expect is redirected to a datanode where the file data is to be written: + The then is redirected to a datanode where the file data is to be written: HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE... Content-Length: 0 - Step 2: Submit another HTTP PUT expect using the URL in the Location header with the file data to be written. + Step 2: Submit another HTTP PUT then using the URL in the Location header with the file data to be written. curl -i -X PUT -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..." The client receives a HttpStatus.SC_CREATED Created respond with zero content length and the WebHDFS URI of the file in the Location header: @@ -636,7 +636,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "CREATE" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_TEMPORARY_REDIRECT ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + root + "/dir/file" ); @@ -656,7 +656,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "test.txt" ) ) .contentType( "text/plain" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_CREATED ) .when().put( location ); @@ -673,7 +673,7 @@ public class GatewayBasicFuncTest { curl -i -L "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=OPEN [&offset=<LONG>][&length=<LONG>][&buffersize=<INT>]" - The expect is redirected to a datanode where the file data can be read: + The then is redirected to a datanode where the file data can be read: HTTP/1.1 307 TEMPORARY_REDIRECT Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN... Content-Length: 0 @@ -709,7 +709,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "OPEN" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_OK ) .body( is( "TEST" ) ) @@ -743,7 +743,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "DELETE" ) .queryParam( "recursive", "true" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_OK ) .when().delete( driver.getUrl( "WEBHDFS" ) + "/v1" + root ); @@ -840,7 +840,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( userA, "invalid-password" ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "OPEN" ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( driver.getUrl("WEBHDFS") + "/v1" + root + "/dirA700/fileA700" ); @@ -1085,7 +1085,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/open-session-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/open-session-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1110,7 +1110,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-set-fetch-output-serde-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-set-fetch-output-serde-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1134,7 +1134,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-1-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-1-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1158,7 +1158,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-set-server2-http-path-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-set-server2-http-path-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1182,7 +1182,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-2-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-2-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1206,7 +1206,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-set-server2-servermode-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-set-server2-servermode-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1230,7 +1230,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-3-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-3-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1254,7 +1254,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-set-security-authorization-enabled-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-set-security-authorization-enabled-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1278,7 +1278,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-4-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-4-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1302,7 +1302,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-create-table-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-create-table-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1326,7 +1326,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-5-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-5-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1350,7 +1350,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/execute-select-from-table-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/execute-select-from-table-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1374,7 +1374,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/get-result-set-metadata-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/get-result-set-metadata-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1398,7 +1398,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/fetch-results-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/fetch-results-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1422,7 +1422,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-operation-6-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-operation-6-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1446,7 +1446,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body( driver.getResourceBytes( "hive/close-session-request.bin" ) ) .contentType( "application/x-thrift" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( "hive/close-session-result.bin" ) ) ) .contentType( "application/x-thrift" ) @@ -1477,7 +1477,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.XML ) .when().get( driver.getUrl( "WEBHBASE" ) ); @@ -1502,7 +1502,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.JSON ) .when().get( driver.getUrl( "WEBHBASE" ) ); @@ -1525,7 +1525,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", "application/x-protobuf" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( "application/x-protobuf" ) .body( is( driver.getResourceString( resourceName + ".protobuf", UTF8 ) ) ) @@ -1555,7 +1555,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_CREATED ) .contentType( ContentType.XML ) .header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + path ) ) @@ -1575,7 +1575,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_CREATED ) .contentType( ContentType.JSON ) .header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + path ) ) @@ -1595,7 +1595,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode(HttpStatus.SC_CREATED) .contentType("application/x-protobuf") .header("Location", startsWith(driver.getUrl("WEBHBASE") + path)) @@ -1627,7 +1627,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.XML ) .when().get( driver.getUrl( "WEBHBASE" ) + path ); @@ -1652,7 +1652,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.JSON ) .when().get( driver.getUrl( "WEBHBASE" ) + path ); @@ -1675,7 +1675,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", "application/x-protobuf" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) //.content( is( driver.getResourceBytes( resourceName + ".protobuf" ) ) ) .contentType( "application/x-protobuf" ) @@ -1714,7 +1714,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", ContentType.XML.toString() ) .body( driver.getResourceBytes( resourceName + ".xml" ) ) .contentType( ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().put(driver.getUrl("WEBHBASE") + multipleRowPath); driver.assertComplete(); @@ -1734,7 +1734,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", ContentType.JSON.toString() ) .body( driver.getResourceBytes( resourceName + ".json" ) ) .contentType( ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().put(driver.getUrl("WEBHBASE") + singleRowPath); driver.assertComplete(); @@ -1755,7 +1755,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", "application/x-protobuf" ) .body( driver.getResourceBytes( resourceName + ".protobuf" ) ) .contentType( "application/x-protobuf" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().put( driver.getUrl( "WEBHBASE" ) + multipleRowPath ); driver.assertComplete(); @@ -1778,7 +1778,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", ContentType.XML.toString() ) .body( driver.getResourceBytes( resourceName + ".xml" ) ) .contentType( ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().post( driver.getUrl( "WEBHBASE" ) + multipleRowPath ); driver.assertComplete(); @@ -1798,7 +1798,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", ContentType.JSON.toString() ) .body( driver.getResourceBytes( resourceName + ".json" ) ) .contentType( ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().post( driver.getUrl( "WEBHBASE" ) + singleRowPath ); driver.assertComplete(); @@ -1819,7 +1819,7 @@ public class GatewayBasicFuncTest { //.header( "Content-Type", "application/x-protobuf" ) .body( driver.getResourceBytes( resourceName + ".protobuf" ) ) .contentType( "application/x-protobuf" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().post(driver.getUrl("WEBHBASE") + multipleRowPath); driver.assertComplete(); @@ -1848,7 +1848,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().delete(driver.getUrl("WEBHBASE") + "/" + tableId + "/" + rowId); driver.assertComplete(); @@ -1864,7 +1864,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().delete(driver.getUrl("WEBHBASE") + "/" + tableId + "/" + rowId + "/" + familyId); driver.assertComplete(); @@ -1880,7 +1880,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().delete(driver.getUrl("WEBHBASE") + "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId); driver.assertComplete(); @@ -1915,7 +1915,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.XML ) .when().get( driver.getUrl( "WEBHBASE" ) + allRowsPath ); @@ -1940,7 +1940,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.XML ) .when().get( driver.getUrl( "WEBHBASE" ) + rowsStartsWithPath ); @@ -1965,7 +1965,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.JSON ) .when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyPath ); @@ -1988,7 +1988,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.JSON.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.JSON ) .when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyAndColumnPath ); @@ -2023,7 +2023,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Content-Type", ContentType.XML.toString() ) .body( driver.getResourceBytes( scannerDefinitionResourceName + ".xml" ) ) - .expect() + .then() //TODO: Add "Location" header check when issue with incorrect outbound rewrites will be resolved //.header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + createScannerPath ) ) .statusCode( HttpStatus.SC_CREATED ) @@ -2045,7 +2045,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .header( "Accept", ContentType.XML.toString() ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .contentType( ContentType.XML ) .when().get( driver.getUrl( "WEBHBASE" ) + scannerPath + "/" + scannerId ); @@ -2068,7 +2068,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().delete(driver.getUrl("WEBHBASE") + scannerPath + "/" + scannerId); driver.assertComplete(); @@ -2087,7 +2087,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) // .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "MKDIRS" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_BAD_REQUEST ) .when().put( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" ); @@ -2114,7 +2114,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) // .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "LISTSTATUS" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .when().get( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" ); @@ -2230,7 +2230,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ) @@ -2269,7 +2269,7 @@ public class GatewayBasicFuncTest { Response response = given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType("application/json") .when().post(driver.getUrl("RESOURCEMANAGER") + path + (driver.isUseGateway() ? "" : "?user.name=" + username)); @@ -2291,7 +2291,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body(driver.getResourceBytes(resource)) .contentType("application/json") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType("application/json") .when().post(driver.getUrl("RESOURCEMANAGER") + path + (driver.isUseGateway() ? "" : "?user.name=" + username)); @@ -2313,7 +2313,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .body(driver.getResourceBytes(resource)) .contentType("application/json") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType("application/json") .when().put(driver.getUrl("RESOURCEMANAGER") + path + (driver.isUseGateway() ? "" : "?user.name=" + username)); @@ -2384,7 +2384,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ); @@ -2434,7 +2434,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ) @@ -2497,7 +2497,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ) @@ -2562,7 +2562,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ) @@ -2586,7 +2586,7 @@ public class GatewayBasicFuncTest { .preemptive() .basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ) .contentType( contentType ) @@ -2635,7 +2635,7 @@ public class GatewayBasicFuncTest { // .log().all() .auth().preemptive().basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ).contentType( ContentType.JSON ).when() .get( gatewayPath + ( driver.isUseGateway() ? "" : "?user.name=" + username ) ).getBody() @@ -2651,7 +2651,7 @@ public class GatewayBasicFuncTest { given() // .log().all() .auth().preemptive().basic( username, password ) - .header( "X-XSRF-Header", "jksdhfkhdsf" ).expect() + .header( "X-XSRF-Header", "jksdhfkhdsf" ).then() // .log().all() .statusCode( HttpStatus.SC_NOT_FOUND ).when() .get( encryptedTrackingUrl ); @@ -2785,7 +2785,7 @@ public class GatewayBasicFuncTest { // .log().all() .auth().preemptive().basic( username, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() // .log().all() .statusCode( HttpStatus.SC_OK ).contentType( contentType ); @@ -2845,7 +2845,7 @@ public class GatewayBasicFuncTest { // .log().all() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() // .log().all() .statusCode(HttpStatus.SC_OK).contentType(contentType).when() .get(gatewayPath); @@ -2921,7 +2921,7 @@ public class GatewayBasicFuncTest { Response response = given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .when().get( gatewayPath ); @@ -3046,7 +3046,7 @@ public class GatewayBasicFuncTest { Response response = given() .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .when().get( gatewayPath ); @@ -3104,7 +3104,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", contentType.toString()) - .expect() + .then() // .log().all() .statusCode(HttpStatus.SC_OK) .contentType( contentType ) @@ -3150,7 +3150,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", contentType.toString()) .body(driver.getResourceBytes(postResource)) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(contentType.toString()) .when().post(gatewayPath); @@ -3170,7 +3170,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", contentType.toString()) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(contentType.toString()) .when().post(gatewayPath); @@ -3235,7 +3235,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", ContentType.JSON.toString()) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.JSON.toString() ) .when().get( gatewayPath ); @@ -3265,7 +3265,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", ContentType.JSON.toString()) - .expect() + .then() // .log().all() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.JSON.toString() ) @@ -3314,7 +3314,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", ContentType.JSON.toString()) - .expect() + .then() // .log().all() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.JSON.toString() ) @@ -3344,7 +3344,7 @@ public class GatewayBasicFuncTest { .header("X-XSRF-Header", "jksdhfkhdsf") .header("X-CSRF-Token", "H/8xIWCYQo4ZDWLvV9k0FAkjD0omWI8beVTp2mEPRxCbJmWBTYhRMhIV9LGIY3E51OAj+s6T7eQChpGJ") .header("Accept", ContentType.JSON.toString()) - .expect() + .then() .statusCode(HttpStatus.SC_MOVED_TEMPORARILY) .contentType( ContentType.JSON.toString() ) .when().post( gatewayPath ); @@ -3388,7 +3388,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", ContentType.JSON.toString()) - .expect() + .then() //.log().all() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.JSON.toString() ) @@ -3446,7 +3446,7 @@ public class GatewayBasicFuncTest { .header("X-Forwarded-Port", port) .header("X-Forwarded-Server", "what") .header("X-Forwarded-For", "what, boo") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(ContentType.JSON.toString()) .when().get(gatewayPath); @@ -3486,7 +3486,7 @@ public class GatewayBasicFuncTest { .header("X-Forwarded-Port", port) .header("X-Forwarded-Server", "what") .header("X-Forwarded-For", "what, boo") - .expect() + .then() // .log().all() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.JSON.toString() ) @@ -3528,7 +3528,7 @@ public class GatewayBasicFuncTest { .header("X-Forwarded-Server", "what") .header("X-Forwarded-For", "what, boo") .queryParam( "op", "CREATE" ) - .expect() + .then() //.log().ifError() .statusCode( HttpStatus.SC_TEMPORARY_REDIRECT ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + root + "/dir/file" ); @@ -3560,7 +3560,7 @@ public class GatewayBasicFuncTest { setupResources(); given() .header(new Header("Accept", MediaType.APPLICATION_XML)) - .expect() + .then() .contentType(MediaType.APPLICATION_XML) .statusCode(HttpStatus.SC_OK) .body(not(containsString("<httpCode>401"))) @@ -3576,7 +3576,7 @@ public class GatewayBasicFuncTest { setupResources(); given() .header(new Header("Accept", MediaType.APPLICATION_JSON)) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) .body(not(containsString("\"httpCode\" : 401"))) @@ -3593,7 +3593,7 @@ public class GatewayBasicFuncTest { given() .header(new Header("Accept", MediaType.APPLICATION_JSON)) .auth().preemptive().basic("kminder", "kminder-password") - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) .body(not(containsString("\"httpCode\" : 401"))) @@ -3611,7 +3611,7 @@ public class GatewayBasicFuncTest { setupResources(); given() .header(new Header("Accept", MediaType.APPLICATION_JSON)) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) .body(not(containsString("\"httpCode\" : 200"))) @@ -3633,7 +3633,7 @@ public class GatewayBasicFuncTest { setupResources(); given() .header(new Header("Accept", MediaType.APPLICATION_JSON)) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) .body(not(containsString("\"httpCode\" : 401"))) @@ -3733,7 +3733,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .header("Accept", ContentType.XML.toString()) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType( ContentType.XML.toString() ) .when().get( gatewayPath ); @@ -3761,7 +3761,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( username, password ) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam( "op", "GET" ) - .expect() + .then() .statusCode( HttpStatus.SC_OK ) .when().get( driver.getUrl( "KAFKA" ) + "/topics" ); @@ -3844,7 +3844,7 @@ public class GatewayBasicFuncTest { .header( "X-XSRF-Header", "jksdhfkhdsf" ) .queryParam( "op", "CREATE" ) .queryParam( "permission", permsOctal ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( driver.getUrl( "WEBHDFS" ) + "/v1" + file + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ); @@ -3884,7 +3884,7 @@ public class GatewayBasicFuncTest { .header( "X-XSRF-Header", "jksdhfkhdsf" ) .contentType( contentType ) .body( driver.getResourceBytes( resource ) ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( location ); @@ -3944,14 +3944,14 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( user, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) .queryParam( "op", "OPEN" ) - .expect() + .then() //.log().all() .statusCode( status ) .when().get( driver.getUrl("WEBHDFS") + "/v1" + file + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ); if( response.getStatusCode() == HttpStatus.SC_OK ) { String actualContent = response.asString(); - String expectedContent = driver.getResourceString( resource, Charset.forName("UTF-8") ); - assertThat( actualContent, Matchers.is(expectedContent) ); + String thenedContent = driver.getResourceString( resource, Charset.forName("UTF-8") ); + assertThat( actualContent, Matchers.is(thenedContent) ); } driver.assertComplete(); } @@ -3974,7 +3974,7 @@ public class GatewayBasicFuncTest { .queryParam( "op", "SETOWNER" ) .queryParam( "owner", owner ) .queryParam( "group", group ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + file + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ); @@ -3997,7 +3997,7 @@ public class GatewayBasicFuncTest { .header( "X-XSRF-Header", "jksdhfkhdsf" ) .queryParam( "op", "SETPERMISSION" ) .queryParam( "permission", permsOctal ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + file + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ); @@ -4043,7 +4043,7 @@ public class GatewayBasicFuncTest { .queryParam( "op", "CREATE" ) .queryParam( "overwrite", "true" ) .body( driver.getResourceBytes( resource ) ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( driver.getUrl("WEBHDFS") + "/v1" + file + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ); @@ -4085,7 +4085,7 @@ public class GatewayBasicFuncTest { .queryParam( "overwrite", "true" ) .contentType( contentType ) .body( driver.getResourceBytes( resource ) ) - .expect() + .then() //.log().all() .statusCode( status ) .when().put( location ); @@ -4106,7 +4106,7 @@ public class GatewayBasicFuncTest { .header( "X-XSRF-Header", "jksdhfkhdsf" ) .queryParam( "op", "DELETE" ) .queryParam( "recursive", recursive ) - .expect() + .then() //.log().all() .statusCode( Matchers.isIn(ArrayUtils.toObject(status)) ) .when() @@ -4132,7 +4132,7 @@ public class GatewayBasicFuncTest { .header( "X-XSRF-Header", "jksdhfkhdsf" ) .queryParam( "op", "MKDIRS" ) .queryParam( "permission", permsOctal ) - .expect() + .then() //.log().all() .statusCode( status ) .contentType( "application/json" ) @@ -4172,7 +4172,7 @@ public class GatewayBasicFuncTest { .formParam( "jar", jar ) //"/user/hdfs/test/hadoop-examples.jar" ) .formParam( "class", main ) //"org.apache.org.apache.hadoop.examples.WordCount" ) .formParam( "arg", input, output ) //.formParam( "arg", "/user/hdfs/test/input", "/user/hdfs/test/output" ) - .expect() + .then() //.log().all() .statusCode( status ) .when().post( driver.getUrl( "WEBHCAT" ) + "/v1/mapreduce/jar" + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ).asString(); @@ -4202,7 +4202,7 @@ public class GatewayBasicFuncTest { .formParam( "file", file ) .formParam( "arg", arg ) .formParam( "statusdir", statusDir ) - .expect() + .then() //.log().all(); .statusCode( Matchers.isIn(ArrayUtils.toObject(status)) ) .contentType( "application/json" ) @@ -4235,7 +4235,7 @@ public class GatewayBasicFuncTest { .formParam( "group", group ) .formParam( "file", file ) .formParam( "statusdir", statusDir ) - .expect() + .then() //.log().all() .statusCode( Matchers.isIn(ArrayUtils.toObject(status)) ) .contentType( "application/json" ) @@ -4264,7 +4264,7 @@ public class GatewayBasicFuncTest { .auth().preemptive().basic( user, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) .pathParam( "job", job ) - .expect() + .then() //.log().all() .body( "status.jobId", CoreMatchers.equalTo(job) ) .statusCode( HttpStatus.SC_OK ) @@ -4285,7 +4285,7 @@ public class GatewayBasicFuncTest { given() .auth().preemptive().basic( user, password ) .header( "X-XSRF-Header", "jksdhfkhdsf" ) - .expect() + .then() .statusCode( 200 ) .body( "", Matchers.hasItems(0, 1) ) .when().get( driver.getUrl( "OOZIE" ) + "/versions" + ( driver.isUseGateway() ? "" : "?user.name=" + user ) ).asString(); @@ -4401,7 +4401,7 @@ public class GatewayBasicFuncTest { // .queryParam( "action", "start" ) // .contentType( "application/xml;charset=UTF-8" ) // .content( request ) -// .expect() +// .then() // .log().all() // .statusCode( status ) // .when().post( getUrl( "OOZIE" ) + "/v1/jobs" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString(); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java index 744fd85..9b700bf 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayDeployFuncTest.java @@ -244,7 +244,7 @@ public class GatewayDeployFuncTest { // Make sure the test topology is not accessible. given().auth().preemptive().basic( username, password ) - .expect().statusCode( HttpStatus.SC_NOT_FOUND ) + .then().statusCode( HttpStatus.SC_NOT_FOUND ) .when().get( serviceUrl ); // Make sure deployment directory is empty. http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 033f028..a5b5516 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 @@ -174,7 +174,7 @@ public class GatewayHealthFuncTest { String body = given() .auth().preemptive().basic(username, password) .header("Accept", MediaType.TEXT_PLAIN) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.TEXT_PLAIN) .when().get(serviceUrl).asString(); @@ -190,7 +190,7 @@ public class GatewayHealthFuncTest { String serviceUrl = clusterUrl + "/v1/metrics"; String body = given() .auth().preemptive().basic(username, password) - .expect() + .then() .statusCode(HttpStatus.SC_OK) .contentType(MediaType.APPLICATION_JSON) .when().get(serviceUrl).asString(); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 49ae6ed..645279d 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 @@ -259,7 +259,7 @@ public class GatewayLdapDynamicGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -277,7 +277,7 @@ public class GatewayLdapDynamicGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_FORBIDDEN ) .when().get( serviceUrl ); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java index 68b9b5e..b7814e4 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLdapGroupFuncTest.java @@ -253,7 +253,7 @@ public class GatewayLdapGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -271,7 +271,7 @@ public class GatewayLdapGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_FORBIDDEN ) .when().get( serviceUrl ); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 f0b9fd0..1d96a20 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 @@ -234,7 +234,7 @@ public class GatewayLdapPosixGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -251,7 +251,7 @@ public class GatewayLdapPosixGroupFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_FORBIDDEN ) .when().get( serviceUrl ); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java index dff3182..a72480a 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayLocalServiceFuncTest.java @@ -168,7 +168,7 @@ public class GatewayLocalServiceFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 2c2371f..8d48d24 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 @@ -182,7 +182,7 @@ public class GatewayMultiFuncTest { String json = given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "application/json; charset=UTF-8" ) @@ -195,7 +195,7 @@ public class GatewayMultiFuncTest { byte[] bytes = given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "application/octet-stream" ) @@ -319,7 +319,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -328,7 +328,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, invalidPword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-1/test-service-path/test-resource-path" ); @@ -341,7 +341,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -350,7 +350,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, invalidPword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-2/test-service-path/test-resource-path" ); @@ -363,7 +363,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -372,7 +372,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, invalidPword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-3/test-service-path/test-resource-path" ); @@ -385,7 +385,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -394,7 +394,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, invalidPword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-4/test-service-path/test-resource-path" ); @@ -407,7 +407,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -416,7 +416,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, invalidPword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-5/test-service-path/test-resource-path" ); @@ -429,7 +429,7 @@ public class GatewayMultiFuncTest { given() //.log().all() .auth().preemptive().basic( uname, pword ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_UNAUTHORIZED ) .when().get( gatewayUrl + "/knox694-6/test-service-path/test-resource-path" ); http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 848daa5..b15dffe 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 @@ -160,7 +160,7 @@ public class GatewayPortMappingDisableFeatureTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam("op", "LISTSTATUS") - .expect() + .then() .log().ifError() .statusCode(HttpStatus.SC_OK) .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs")) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFailTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFailTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFailTest.java index c4e7794..fecc9e3 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFailTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayPortMappingFailTest.java @@ -136,7 +136,7 @@ public class GatewayPortMappingFailTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam("op", "LISTSTATUS") - .expect() + .then() //.log().ifError() .statusCode(HttpStatus.SC_NOT_FOUND) //.content("FileStatuses.FileStatus[0].pathSuffix", is("app-logs")) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 3e09730..a0c2cdb 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 @@ -184,7 +184,7 @@ public class GatewayPortMappingFuncTest { .auth().preemptive().basic(username, password) .header("X-XSRF-Header", "jksdhfkhdsf") .queryParam("op", "LISTSTATUS") - .expect() + .then() .log().ifError() .statusCode(HttpStatus.SC_OK) .body("FileStatuses.FileStatus[0].pathSuffix", is("app-logs")) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java index 9e66887..4c335ae 100644 --- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java +++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewaySampleFuncTest.java @@ -166,7 +166,7 @@ public class GatewaySampleFuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) http://git-wip-us.apache.org/repos/asf/knox/blob/4978951c/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 a7465d1..a5eb89c 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 @@ -254,7 +254,7 @@ public class Knox242FuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_OK ) .contentType( "text/plain" ) @@ -272,7 +272,7 @@ public class Knox242FuncTest { given() //.log().all() .auth().preemptive().basic( username, password ) - .expect() + .then() //.log().all() .statusCode( HttpStatus.SC_FORBIDDEN ) .when().get( serviceUrl );