/** Helper method that just executes the provided test with CITE validation activated. */ private void testCiteValidationIsSuccessful(TestToExecute request) throws Exception { // mock server configuration to activate CITE compliance checks ServerConfiguration configuration = mock(ServerConfiguration.class); when(configuration.isWmtsCiteCompliant()).thenReturn(true); ServerConfiguration previousConfiguration = wmtsService.getMainConfiguration(); wmtsService.setMainConfiguration(configuration); try { // the following test should be successful request.execute(); } finally { // set whatever was the previous server configuration used by WMTS service wmtsService.setMainConfiguration(previousConfiguration); } }