@Test public void getConfiguration_Exception() throws Exception { GetConfigurationException exception = new GetConfigurationException("error"); when(mockAuthentication.getName()).thenReturn("user"); when(mockArkCaseTranscribeService.getConfiguration()).thenThrow(exception); try { mockMvc.perform(get("/api/v1/plugin/admin/transcribe/configuration") .accept(MediaType.parseMediaType("application/json;charset=UTF-8")) .contentType(MediaType.APPLICATION_JSON) .principal(mockAuthentication)) .andReturn(); } catch (Exception e) { assertNotNull(e); assertTrue(e.getCause() instanceof GetConfigurationException); assertEquals("error", e.getCause().getMessage()); } }
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public TranscribeConfiguration getConfiguration() throws GetConfigurationException { return getArkCaseTranscribeService().getConfiguration(); }
GetTranscribeConfigurationAPIController { @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public TranscribeConfiguration getConfiguration() throws GetConfigurationException { return getArkCaseTranscribeService().getConfiguration(); } }
GetTranscribeConfigurationAPIController { @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public TranscribeConfiguration getConfiguration() throws GetConfigurationException { return getArkCaseTranscribeService().getConfiguration(); }  }
GetTranscribeConfigurationAPIController { @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public TranscribeConfiguration getConfiguration() throws GetConfigurationException { return getArkCaseTranscribeService().getConfiguration(); }  @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody TranscribeConfiguration getConfiguration(); ArkCaseTranscribeService getArkCaseTranscribeService(); void setArkCaseTranscribeService(ArkCaseTranscribeService arkCaseTranscribeService); }
GetTranscribeConfigurationAPIController { @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public TranscribeConfiguration getConfiguration() throws GetConfigurationException { return getArkCaseTranscribeService().getConfiguration(); }  @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody TranscribeConfiguration getConfiguration(); ArkCaseTranscribeService getArkCaseTranscribeService(); void setArkCaseTranscribeService(ArkCaseTranscribeService arkCaseTranscribeService);  }