@Test public void create_Transcribe_Configuration_Not_Retrieved() throws Exception { String expectedErrorMessage = "Transcribe failed to create on Amazon. REASON=[Failed to retrieve Configuration.]"; try { awsTranscribeService.create(null); } catch (Exception e) { assertTrue(e instanceof CreateTranscribeException); assertEquals(expectedErrorMessage, e.getMessage()); } }
@Override @Async public Transcribe create(Transcribe transcribe) throws CreateTranscribeException { AWSTranscribeConfiguration configuration = null; try { configuration = getConfiguration(); } catch (GetConfigurationException e) { getTranscribeEventPublisher().publish(transcribe, TranscribeActionType.PROVIDER_FAILED.toString()); throw new CreateTranscribeException(String.format("Transcribe failed to create on Amazon. REASON=[%s]", e.getMessage()), e); } checkIfMediaExist(transcribe, configuration.getBucket()); uploadMedia(transcribe); startTranscribeJob(transcribe); return transcribe; }
AWSTranscribeService implements TranscribeService, AcmConfigurablePlugin { @Override @Async public Transcribe create(Transcribe transcribe) throws CreateTranscribeException { AWSTranscribeConfiguration configuration = null; try { configuration = getConfiguration(); } catch (GetConfigurationException e) { getTranscribeEventPublisher().publish(transcribe, TranscribeActionType.PROVIDER_FAILED.toString()); throw new CreateTranscribeException(String.format("Transcribe failed to create on Amazon. REASON=[%s]", e.getMessage()), e); } checkIfMediaExist(transcribe, configuration.getBucket()); uploadMedia(transcribe); startTranscribeJob(transcribe); return transcribe; } }
AWSTranscribeService implements TranscribeService, AcmConfigurablePlugin { @Override @Async public Transcribe create(Transcribe transcribe) throws CreateTranscribeException { AWSTranscribeConfiguration configuration = null; try { configuration = getConfiguration(); } catch (GetConfigurationException e) { getTranscribeEventPublisher().publish(transcribe, TranscribeActionType.PROVIDER_FAILED.toString()); throw new CreateTranscribeException(String.format("Transcribe failed to create on Amazon. REASON=[%s]", e.getMessage()), e); } checkIfMediaExist(transcribe, configuration.getBucket()); uploadMedia(transcribe); startTranscribeJob(transcribe); return transcribe; }  }
AWSTranscribeService implements TranscribeService, AcmConfigurablePlugin { @Override @Async public Transcribe create(Transcribe transcribe) throws CreateTranscribeException { AWSTranscribeConfiguration configuration = null; try { configuration = getConfiguration(); } catch (GetConfigurationException e) { getTranscribeEventPublisher().publish(transcribe, TranscribeActionType.PROVIDER_FAILED.toString()); throw new CreateTranscribeException(String.format("Transcribe failed to create on Amazon. REASON=[%s]", e.getMessage()), e); } checkIfMediaExist(transcribe, configuration.getBucket()); uploadMedia(transcribe); startTranscribeJob(transcribe); return transcribe; }  void init(); @Override @Async Transcribe create(Transcribe transcribe); @Override Transcribe get(String remoteId); @Override List<Transcribe> getAll(); @Override List<Transcribe> getAllByStatus(String status); @Override List<Transcribe> getPage(int start, int n); @Override List<Transcribe> getPageByStatus(int start, int n, String status); @Override boolean purge(Transcribe transcribe); AWSTranscribeConfiguration getConfiguration(); AWSTranscribeConfiguration saveConfiguration(AWSTranscribeConfiguration configuration); AmazonS3 getS3Client(); void setS3Client(AmazonS3 s3Client); AmazonTranscribe getTranscribeClient(); void setTranscribeClient(AmazonTranscribe transcribeClient); EcmFileTransaction getEcmFileTransaction(); void setEcmFileTransaction(EcmFileTransaction ecmFileTransaction); AWSTranscribeConfigurationPropertiesService getAwsTranscribeConfigurationPropertiesService(); void setAwsTranscribeConfigurationPropertiesService(
            AWSTranscribeConfigurationPropertiesService awsTranscribeConfigurationPropertiesService); MuleContextManager getMuleContextManager(); void setMuleContextManager(MuleContextManager muleContextManager); TranscribeConfigurationPropertiesService getTranscribeConfigurationPropertiesService(); void setTranscribeConfigurationPropertiesService(
            TranscribeConfigurationPropertiesService transcribeConfigurationPropertiesService); String getCredentialConfigurationFileLocation(); void setCredentialConfigurationFileLocation(String credentialConfigurationFileLocation); TranscribeEventPublisher getTranscribeEventPublisher(); void setTranscribeEventPublisher(TranscribeEventPublisher transcribeEventPublisher); @Override boolean isEnabled(); @Override String getName(); }
AWSTranscribeService implements TranscribeService, AcmConfigurablePlugin { @Override @Async public Transcribe create(Transcribe transcribe) throws CreateTranscribeException { AWSTranscribeConfiguration configuration = null; try { configuration = getConfiguration(); } catch (GetConfigurationException e) { getTranscribeEventPublisher().publish(transcribe, TranscribeActionType.PROVIDER_FAILED.toString()); throw new CreateTranscribeException(String.format("Transcribe failed to create on Amazon. REASON=[%s]", e.getMessage()), e); } checkIfMediaExist(transcribe, configuration.getBucket()); uploadMedia(transcribe); startTranscribeJob(transcribe); return transcribe; }  void init(); @Override @Async Transcribe create(Transcribe transcribe); @Override Transcribe get(String remoteId); @Override List<Transcribe> getAll(); @Override List<Transcribe> getAllByStatus(String status); @Override List<Transcribe> getPage(int start, int n); @Override List<Transcribe> getPageByStatus(int start, int n, String status); @Override boolean purge(Transcribe transcribe); AWSTranscribeConfiguration getConfiguration(); AWSTranscribeConfiguration saveConfiguration(AWSTranscribeConfiguration configuration); AmazonS3 getS3Client(); void setS3Client(AmazonS3 s3Client); AmazonTranscribe getTranscribeClient(); void setTranscribeClient(AmazonTranscribe transcribeClient); EcmFileTransaction getEcmFileTransaction(); void setEcmFileTransaction(EcmFileTransaction ecmFileTransaction); AWSTranscribeConfigurationPropertiesService getAwsTranscribeConfigurationPropertiesService(); void setAwsTranscribeConfigurationPropertiesService(
            AWSTranscribeConfigurationPropertiesService awsTranscribeConfigurationPropertiesService); MuleContextManager getMuleContextManager(); void setMuleContextManager(MuleContextManager muleContextManager); TranscribeConfigurationPropertiesService getTranscribeConfigurationPropertiesService(); void setTranscribeConfigurationPropertiesService(
            TranscribeConfigurationPropertiesService transcribeConfigurationPropertiesService); String getCredentialConfigurationFileLocation(); void setCredentialConfigurationFileLocation(String credentialConfigurationFileLocation); TranscribeEventPublisher getTranscribeEventPublisher(); void setTranscribeEventPublisher(TranscribeEventPublisher transcribeEventPublisher); @Override boolean isEnabled(); @Override String getName();  }