.queryParam( "user.name", username )
.respond()
.status( HttpStatus.SC_OK )
.content( driver.getResourceBytes( "webhdfs-success.json" ) )
.contentType( "application/json" );
Cookie cookie = given()
//.log().all()
.auth().preemptive().basic( username, password )
.header("X-XSRF-Header", "jksdhfkhdsf")
.queryParam( "op", "MKDIRS" )
.expect()
//.log().all()
.statusCode( HttpStatus.SC_OK )
.header( "Set-Cookie", containsString( "JSESSIONID" ) )
.header( "Set-Cookie", containsString( "HttpOnly" ) )
.contentType( "application/json" )
.content( "boolean", is( true ) )
.when().put( driver.getUrl( "WEBHDFS" ) + "/v1" + root + "/dir" ).getDetailedCookie( "JSESSIONID" );
assertThat( cookie.isSecured(), is( true ) );
assertThat( cookie.getPath(), is( "/gateway/cluster" ) );
assertThat( cookie.getValue().length(), greaterThan( 16 ) );
driver.assertComplete();
}