RegisterNamedStyleInfoCommand implements
		CommandHasRequest<RegisterNamedStyleInfoRequest, RegisterNamedStyleInfoResponse> { @Override public void execute(RegisterNamedStyleInfoRequest request, RegisterNamedStyleInfoResponse response) throws Exception { response.setStyleName(styleService.registerStyle(request.getLayerId(), request.getNamedStyleInfo())); }  @Override RegisterNamedStyleInfoRequest getEmptyCommandRequest(); @Override RegisterNamedStyleInfoResponse getEmptyCommandResponse(); @Override void execute(RegisterNamedStyleInfoRequest request, RegisterNamedStyleInfoResponse response);  }
@Test public void testRegisterStyle() throws Exception { NamedStyleInfo nsi = new NamedStyleInfo(); nsi.setName("test"); RegisterNamedStyleInfoRequest req = new RegisterNamedStyleInfoRequest(); req.setLayerId("countries"); req.setNamedStyleInfo(nsi); CommandResponse response = dispatcher.execute( RegisterNamedStyleInfoRequest.COMMAND, req, null, "en"); if (response.isError()) { response.getErrors().get(0).printStackTrace(); } Assert.assertFalse(response.isError()); Assert.assertTrue(response instanceof RegisterNamedStyleInfoResponse); Assert.assertEquals(nsi, styleService.retrieveStyle("countries", ((RegisterNamedStyleInfoResponse) response).getStyleName())); }