Github user shawnfeldman commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/197#discussion_r27051207
  
    --- Diff: 
stack/rest/src/test/java/org/apache/usergrid/rest/management/ExportResourceIT.java
 ---
    @@ -60,734 +61,729 @@ public void exportCallSuccessful() throws Exception {
     
             HashMap<String, Object> payload = payloadBuilder();
     
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token )
    -                              .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                              .post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -        assertEquals( ClientResponse.Status.OK, responseStatus );
    -    }
    -
    -
    -    @Ignore( "is this test still valid knowing that the sch. won't run in 
intelliJ?" )
    -    public void exportCallCreationEntities100() throws Exception {
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -        JsonNode node = null;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = new HashMap<String, Object>();
    -        Map<String, Object> properties = new HashMap<String, Object>();
    -        Map<String, Object> storage_info = new HashMap<String, Object>();
    -        //TODO: make sure to put a valid admin token here.
    -        //TODO: always put dummy values here and ignore this test.
    -
    -
    -        properties.put( "storage_provider", "s3" );
    -        properties.put( "storage_info", storage_info );
    -
    -        payload.put( "properties", properties );
    -
    -        for ( int i = 0; i < 100; i++ ) {
    -            Map<String, String> userCreation = hashMap( "type", "app_user" 
).map( "name", "fred" + i );
    -
    -            node = mapper.readTree( resource().path( "/test-organization/" 
+ appName + "/app_users" )
    -                                              .queryParam( "access_token", 
access_token )
    -                                              .accept( 
MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE )
    -                                              .post( String.class, 
userCreation ) );
    -        }
    -
    -        try {
    -            node = mapper.readTree( resource().path( 
"/management/orgs/test-organization/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
adminToken() )
    -                                              .accept( 
MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -        assertEquals( ClientResponse.Status.OK, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportApplicationUUIDRetTest() throws Exception {
    -        ClientResponse.Status responseStatus = 
ClientResponse.Status.ACCEPTED;
    -        String uuid;
    -        UUID jobUUID = null;
    -        JsonNode node = null;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -        assertEquals( ClientResponse.Status.ACCEPTED, responseStatus );
    -        assertNotNull( node.get( "Export Entity" ) );
    -    }
    -
    -
    -    //
    -    @Test
    -    public void exportCollectionUUIDRetTest() throws Exception {
    -        ClientResponse.Status responseStatus = 
ClientResponse.Status.ACCEPTED;
    -        String uuid;
    -        UUID jobUUID = null;
    -        JsonNode node = null;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/"+orgName+"/apps/" 
+ appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -        assertEquals( ClientResponse.Status.ACCEPTED, responseStatus );
    -        assertNotNull( node.get( "Export Entity" ) );
    -    }
    -
    -
    -    @Test
    -    public void exportGetOrganizationJobStatTest() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                              .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                              .post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.OK, responseStatus );
    -
    -        String uuid = String.valueOf( node.get( "Export Entity" ) );
    -        uuid = uuid.replaceAll( "\"", "" );
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/export/" + uuid )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -
    -        assertEquals( ClientResponse.Status.OK, responseStatus );
    -        assertEquals( "SCHEDULED", node.get( "state" ).textValue() 
);//TODO: do tests for other states in service tier
    -    }
    -
    -
    -    //all tests should be moved to OrganizationResourceIT ( *not* 
Organizations there is a difference)
    -    @Test
    -    public void exportGetApplicationJobStatTest() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                          .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                          .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        String uuid = String.valueOf( node.get( "Export Entity" ) );
    -        uuid = uuid.replaceAll( "\"", "" );
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/export/" + uuid )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -
    -
    -        assertEquals( ClientResponse.Status.OK, responseStatus );
    -        assertEquals( "SCHEDULED", node.get( "state" ).textValue() 
);//TODO: do tests for other states in service tier
    -    }
    -
    -
    -    @Test
    -    public void exportGetCollectionJobStatTest() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        node = mapper.readTree(
    -                resource().path( "/management/orgs/" + orgName + "/apps/" 
+ appName + "/collection/users/export" )
    -                          .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                          .type( MediaType.APPLICATION_JSON_TYPE ).post( 
String.class, payload ) );
    -        String uuid = String.valueOf( node.get( "Export Entity" ) );
    -        uuid = uuid.replaceAll( "\"", "" );
     
             try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/export/" + uuid )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    +            management().orgs().organization( 
clientSetup.getOrganizationName() )
    +                        .app().addToPath( 
clientSetup.getAppUuid()).addToPath( "collection" )
    +                        .addToPath( "users" ).addToPath( "export" 
).postWithToken(ApiResponse.class,payload  );
             }
             catch ( UniformInterfaceException uie ) {
                 responseStatus = uie.getResponse().getClientResponseStatus();
             }
     
    -
             assertEquals( ClientResponse.Status.OK, responseStatus );
    -        assertEquals( "SCHEDULED", node.get( "state" ).textValue() 
);//TODO: do tests for other states in service tier
    -    }
    -
    -
    -    //    //do an unauthorized test for both post and get
    -    @Test
    -    public void exportGetWrongUUID() throws Exception {
    -        JsonNode node = null;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -        UUID fake = UUID.fromString( 
"AAAAAAAA-FFFF-FFFF-FFFF-AAAAAAAAAAAA" );
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/export/" + fake )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    //
    -    @Test
    -    public void exportPostApplicationNullPointerProperties() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = new HashMap<String, Object>();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostOrganizationNullPointerProperties() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = new HashMap<String, Object>();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                              .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                              .post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    //
    -    @Test
    -    public void exportPostCollectionNullPointer() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = new HashMap<String, Object>();
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportGetCollectionUnauthorized() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -        UUID fake = UUID.fromString( 
"AAAAAAAA-FFFF-FFFF-FFFF-AAAAAAAAAAAA" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree( resource()
    -                    .path( "/management/orgs/" + orgName + "/apps/" + 
appName + "/collection/users/export/" + fake )
    -                    .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.UNAUTHORIZED, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportGetApplicationUnauthorized() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -        UUID fake = UUID.fromString( 
"AAAAAAAA-FFFF-FFFF-FFFF-AAAAAAAAAAAA" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/export/" + fake )
    -                              .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                              .get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.UNAUTHORIZED, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportGetOrganizationUnauthorized() throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -        UUID fake = UUID.fromString( 
"AAAAAAAA-FFFF-FFFF-FFFF-AAAAAAAAAAAA" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/export/" + fake )
    -                                              .accept( 
MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).get( String.class ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.UNAUTHORIZED, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostOrganizationNullPointerStorageInfo() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_info" );
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                              .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                              .post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostApplicationNullPointerStorageInfo() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_info" );
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostCollectionNullPointerStorageInfo() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_info" );
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostOrganizationNullPointerStorageProvider() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_provider" );
    -
    -
    -        try {
    -            node = resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                             .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                             .post( JsonNode.class, payload );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostApplicationNullPointerStorageProvider() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_provider" );
    -
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostCollectionNullPointerStorageProvider() throws 
Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        //remove storage_info field
    -        properties.remove( "storage_provider" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostOrganizationNullPointerStorageVerification() 
throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        HashMap<String, Object> storage_info = ( HashMap<String, Object> ) 
properties.get( "storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( "s3_key" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                             .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                             .post( JsonNode.class, payload );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR );
    -
    -        try {
    -            node = resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                             .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                             .post( JsonNode.class, payload );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( "bucket_location" );
    -
    -        try {
    -            node = resource().path( "/management/orgs/" + orgName + 
"/export" ).queryParam( "access_token", token )
    -                             .accept( MediaType.APPLICATION_JSON ).type( 
MediaType.APPLICATION_JSON_TYPE )
    -                             .post( JsonNode.class, payload );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostApplicationNullPointerStorageVerification() 
throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        HashMap<String, Object> storage_info = ( HashMap<String, Object> ) 
properties.get( "storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( "s3_key" );
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR );
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( "bucket_location" );
    -
    -        try {
    -            node = mapper.readTree( resource().path( "/management/orgs/" + 
orgName + "/apps/" + appName + "/export" )
    -                                              .queryParam( "access_token", 
token ).accept( MediaType.APPLICATION_JSON )
    -                                              .type( 
MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -    }
    -
    -
    -    @Test
    -    public void exportPostCollectionNullPointerStorageVerification() 
throws Exception {
    -        JsonNode node = null;
    -        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
    -
    -        String orgName = context.getOrgName();
    -        String appName = context.getAppName();
    -        String token = context.getActiveUser().getToken();
    -
    -        HashMap<String, Object> payload = payloadBuilder();
    -        HashMap<String, Object> properties = ( HashMap<String, Object> ) 
payload.get( "properties" );
    -        HashMap<String, Object> storage_info = ( HashMap<String, Object> ) 
properties.get( "storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( "s3_key" );
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        //remove storage_key field
    -        storage_info.remove( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR);
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
    -
    -        payload = payloadBuilder();
    -        properties = ( HashMap<String, Object> ) payload.get( "properties" 
);
    -        storage_info = ( HashMap<String, Object> ) properties.get( 
"storage_info" );
    -        storage_info.remove( "bucket_location" );
    -
    -        try {
    -            node = mapper.readTree(
    -                    resource().path( "/management/orgs/" + orgName + 
"/apps/" + appName + "/collection/users/export" )
    -                              .queryParam( "access_token", token ).accept( 
MediaType.APPLICATION_JSON )
    -                              .type( MediaType.APPLICATION_JSON_TYPE 
).post( String.class, payload ) );
    -        }
    -        catch ( UniformInterfaceException uie ) {
    -            responseStatus = uie.getResponse().getClientResponseStatus();
    -        }
    -        assertEquals( ClientResponse.Status.BAD_REQUEST, responseStatus );
         }
     
    -
    +//
    +//    @Ignore( "is this test still valid knowing that the sch. won't run 
in intelliJ?" )
    --- End diff --
    
    Why just comment out? can you just delete this?  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to