@Test public void getConfiguration() throws Exception { TranscribeConfiguration configuration = new TranscribeConfiguration(); configuration.setEnabled(true); configuration.setAutomaticEnabled(true); configuration.setNewTranscriptionForNewVersion(false); configuration.setCopyTranscriptionForNewVersion(true); configuration.setCost(new BigDecimal("0.001")); configuration.setConfidence(80); configuration.setNumberOfFilesForProcessing(10); configuration.setWordCountPerItem(30); configuration.setProvider(TranscribeServiceProvider.AWS); configuration.setProviders(Arrays.asList(TranscribeServiceProvider.AWS)); when(mockAuthentication.getName()).thenReturn("user"); when(mockArkCaseTranscribeService.getConfiguration()).thenReturn(configuration); MvcResult result = mockMvc.perform(get("/api/v1/plugin/admin/transcribe/configuration") .accept(MediaType.parseMediaType("application/json;charset=UTF-8")) .contentType(MediaType.APPLICATION_JSON) .principal(mockAuthentication)) .andReturn(); verify(mockAuthentication).getName(); verify(mockArkCaseTranscribeService).getConfiguration(); String responseString = result.getResponse().getContentAsString(); LOG.info("Results: " + responseString); assertEquals(HttpStatus.OK.value(), result.getResponse().getStatus()); ObjectMapper objectMapper = new ObjectMapper(); TranscribeConfiguration responseConfiguration = objectMapper.readValue(responseString, TranscribeConfiguration.class); assertNotNull(responseConfiguration); assertEquals(configuration, responseConfiguration); }
@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);  }