GeoWaveOperationServiceWrapper extends ServerResource { @Post("form|json:json") public Representation restPost(final Representation request) throws Exception { return handleRequestWithPayload(HttpMethod.POST, request); } GeoWaveOperationServiceWrapper(
      final ServiceEnabledCommand<T> operation,
      final String initContextConfigFile); @Get("json") Representation restGet(); @Post("form|json:json") Representation restPost(final Representation request); @Delete("form|json:json") Representation restDelete(final Representation request); @Patch("form|json:json") Representation restPatch(final Representation request); @Put("form|json:json") Representation restPut(final Representation request);  }
@Test public void postMethodReturnsSuccessStatus() throws Exception { final Boolean successStatusIs200 = false; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.POST, successStatusIs200); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.restPost(mockedRequest(MediaType.APPLICATION_JSON)); Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); }
@Test @Ignore public void asyncMethodReturnsSuccessStatus() throws Exception { final Boolean successStatusIs200 = true; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.POST, successStatusIs200, true); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.restPost(null); Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); }