GeoWaveOperationServiceWrapper extends ServerResource { @Get("json") public Representation restGet() throws Exception { if (HttpMethod.GET.equals(operation.getMethod())) { return handleRequest(new RequestParametersForm(getQuery())); } else { setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED); return null; } } 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 getMethodReturnsSuccessStatus() throws Exception { final Boolean successStatusIs200 = true; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.GET, successStatusIs200); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.setRequest(new Request(Method.GET, "foo.bar")); classUnderTest.restGet(); Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); }