@Test public void createJobExceptionTest() throws PacManException, JsonParseException, JsonMappingException, IOException { JobDetails createJobDetails = getCreateJobDetailsRequest(); MultipartFile firstFile = getMockMultipartFile(); when(putRuleRequest.withName(anyString()).withDescription(anyString()).withState(anyString())).thenReturn(putRuleRequest); when(putRuleResult.getRuleArn()).thenReturn(null); when(amazonCloudWatchEvents.putRule(any())).thenReturn(putRuleResult); JobProperty jobProperty = buildJobProperty(); when(config.getJob()).thenReturn(jobProperty); Map<String, Object> ruleParamDetails = Maps.newHashMap(); when(mapper.readValue(anyString(), any(TypeReference.class))).thenReturn(ruleParamDetails); assertThatThrownBy(() -> jobExecutionManagerService.createJob(firstFile, createJobDetails, "user123")).isInstanceOf(PacManException.class); }
@Override public String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId) throws PacManException { return addJobExecutionManager(fileToUpload, jobDetails, userId); }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId) throws PacManException { return addJobExecutionManager(fileToUpload, jobDetails, userId); } }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId) throws PacManException { return addJobExecutionManager(fileToUpload, jobDetails, userId); }  }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId) throws PacManException { return addJobExecutionManager(fileToUpload, jobDetails, userId); }  @Override Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm); @Override String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override String updateJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override Collection<String> getAllJobIds(); @Override JobExecutionManager getByJobId(final String jobId); @Override String enableDisableJob(final String jobId, final String action, final String userId); }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId) throws PacManException { return addJobExecutionManager(fileToUpload, jobDetails, userId); }  @Override Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm); @Override String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override String updateJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override Collection<String> getAllJobIds(); @Override JobExecutionManager getByJobId(final String jobId); @Override String enableDisableJob(final String jobId, final String action, final String userId);  }