Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Fix no-org-delete and test.
Browse files Browse the repository at this point in the history
  • Loading branch information
snoopdave committed Nov 13, 2015
1 parent 1434dea commit 59d2a71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Expand Up @@ -20,6 +20,7 @@
import com.fasterxml.jackson.jaxrs.json.annotation.JSONP; import com.fasterxml.jackson.jaxrs.json.annotation.JSONP;
import org.apache.amber.oauth2.common.exception.OAuthSystemException; import org.apache.amber.oauth2.common.exception.OAuthSystemException;
import org.apache.commons.lang.NullArgumentException; import org.apache.commons.lang.NullArgumentException;
import org.apache.usergrid.exception.NotImplementedException;
import org.apache.usergrid.management.ActivationState; import org.apache.usergrid.management.ActivationState;
import org.apache.usergrid.management.OrganizationConfig; import org.apache.usergrid.management.OrganizationConfig;
import org.apache.usergrid.management.OrganizationInfo; import org.apache.usergrid.management.OrganizationInfo;
Expand Down Expand Up @@ -420,4 +421,12 @@ public ApiResponse putConfig( @Context UriInfo ui, Map<String, Object> json,
return response; return response;
} }



/** Delete organization is not yet supported */
//@RequireSystemAccess
@DELETE
public ApiResponse deleteOrganization() throws Exception {
throw new NotImplementedException();
}

} }
Expand Up @@ -31,6 +31,7 @@
import org.apache.usergrid.rest.test.resource.RestClient; import org.apache.usergrid.rest.test.resource.RestClient;


import javax.ws.rs.ClientErrorException; import javax.ws.rs.ClientErrorException;
import javax.ws.rs.ServerErrorException;
import javax.ws.rs.core.Form; import javax.ws.rs.core.Form;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;


Expand Down Expand Up @@ -291,18 +292,17 @@ public void testOrgPOSTForm() throws IOException {


/** /**
* Returns error from unimplemented delete method by trying to call the delete organization endpoint * Returns error from unimplemented delete method by trying to call the delete organization endpoint
* @throws IOException
*/ */
@Ignore("It should return a 501, so when this is fixed the test can be run")
@Test @Test
public void noOrgDelete() throws IOException { public void noOrgDelete() throws IOException {


try { try {
//Delete default organization // attempt to delete default organization
clientSetup.getRestClient().management().orgs().org( clientSetup.getOrganizationName() ).delete(); clientSetup.getRestClient().management().orgs().org( clientSetup.getOrganizationName() ).delete();
fail( "Delete is not implemented yet" ); fail( "Delete is not implemented yet" );
}catch(ClientErrorException uie){
assertEquals( Response.Status.NOT_IMPLEMENTED ,uie.getResponse().getStatus()); } catch( ServerErrorException see ){
assertEquals( Response.Status.NOT_IMPLEMENTED.getStatusCode(), see.getResponse().getStatus());
} }
} }


Expand Down

0 comments on commit 59d2a71

Please sign in to comment.