public void testCompositeHistoryEventHandlerArgumentConstructorWithNotEmptyListNullTwoEvents() { // prepare the list with two null events List<HistoryEventHandler> historyEventHandlers = new ArrayList<HistoryEventHandler>(); historyEventHandlers.add(null); historyEventHandlers.add(null); try { new CompositeHistoryEventHandler(historyEventHandlers); fail("NullValueException expected"); } catch (NullValueException e) { assertTextPresent("History event handler is null", e.getMessage()); } }
@Test public void testMessageCorrelationWithoutBusinessKey() { when(messageCorrelationBuilderMock.processInstanceBusinessKey(null)) .thenThrow(new NullValueException()); String messageName = "aMessageName"; Map<String, Object> messageParameters = new HashMap<String, Object>(); messageParameters.put("messageName", messageName); given() .contentType(POST_JSON_CONTENT_TYPE) .body(messageParameters) .then() .expect().statusCode(Status.NO_CONTENT.getStatusCode()) .when().post(MESSAGE_URL); verify(runtimeServiceMock).createMessageCorrelation(eq(messageName)); verify(messageCorrelationBuilderMock, Mockito.never()).processInstanceBusinessKey(anyString()); verify(messageCorrelationBuilderMock).correlateWithResult(); verifyNoMoreInteractions(messageCorrelationBuilderMock); }
.thenReturn((long) 1); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).singleResult(eq(MockProvider.NON_EXISTING_ID)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).singleResult(eq(MockProvider.NON_EXISTING_ID), any(Query.class)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).list(eq(MockProvider.NON_EXISTING_ID)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).list(eq(MockProvider.NON_EXISTING_ID), any(Query.class)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).listPage(eq(MockProvider.NON_EXISTING_ID), anyInt(), anyInt()); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).listPage(eq(MockProvider.NON_EXISTING_ID), any(Query.class), anyInt(), anyInt()); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).count(eq(MockProvider.NON_EXISTING_ID)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).count(eq(MockProvider.NON_EXISTING_ID), any(Query.class)); doThrow(new NullValueException("No filter found with given id")) .when(filterServiceMock).deleteFilter(eq(MockProvider.NON_EXISTING_ID));
public void testCompositeDbHistoryEventHandlerArgumentConstructorWithNotEmptyListNullTwoEvents() { // prepare the list with two null events List<HistoryEventHandler> historyEventHandlers = new ArrayList<HistoryEventHandler>(); historyEventHandlers.add(null); historyEventHandlers.add(null); try { new CompositeDbHistoryEventHandler(historyEventHandlers); fail("NullValueException expected"); } catch (NullValueException e) { assertTextPresent("History event handler is null", e.getMessage()); } }
@Test public void deleteNotExistingJob() { String jobId = MockProvider.NON_EXISTING_JOB_ID; String expectedMessage = "No job found with id '" + jobId + "'."; doThrow(new NullValueException(expectedMessage)) .when(mockManagementService).deleteJob(jobId); given() .pathParam("id", jobId) .then().expect() .statusCode(Status.NOT_FOUND.getStatusCode()) .body("type", equalTo(InvalidRequestException.class.getSimpleName())) .body("message", equalTo(expectedMessage)) .when() .delete(SINGLE_JOB_RESOURCE_URL); verify(mockManagementService).deleteJob(jobId); verifyNoMoreInteractions(mockManagementService); }
@SuppressWarnings("unchecked") protected <T extends TypedValue> T getCaseExecutionVariableTyped(String caseExecutionId, String variableName, boolean isLocal, boolean deserializeValue) { try { return (T) commandExecutor.execute(new GetCaseExecutionVariableTypedCmd(caseExecutionId, variableName, isLocal, deserializeValue)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
protected VariableMap getCaseExecutionVariables(String caseExecutionId, Collection<String> variableNames, boolean isLocal, boolean deserializeValues) { try { return commandExecutor.execute(new GetCaseExecutionVariablesCmd(caseExecutionId, variableNames, isLocal, deserializeValues)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
protected VariableMap getCaseExecutionVariables(String caseExecutionId, Collection<String> variableNames, boolean isLocal, boolean deserializeValues) { try { return commandExecutor.execute(new GetCaseExecutionVariablesCmd(caseExecutionId, variableNames, isLocal, deserializeValues)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
protected Object getCaseExecutionVariable(String caseExecutionId, String variableName, boolean isLocal) { try { return commandExecutor.execute(new GetCaseExecutionVariableCmd(caseExecutionId, variableName, isLocal)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
protected Object getCaseExecutionVariable(String caseExecutionId, String variableName, boolean isLocal) { try { return commandExecutor.execute(new GetCaseExecutionVariableCmd(caseExecutionId, variableName, isLocal)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public void deleteJob() { try { engine.getManagementService() .deleteJob(jobId); } catch (AuthorizationException e) { throw e; } catch (NullValueException e) { throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage()); } catch (ProcessEngineException e) { throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage()); } }
public DecisionRequirementsDefinition getDecisionRequirementsDefinition(String decisionRequirementsDefinitionId) { try { return commandExecutor.execute(new GetDeploymentDecisionRequirementsDefinitionCmd(decisionRequirementsDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (DecisionDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public CaseDefinition getCaseDefinition(String caseDefinitionId) { try { return commandExecutor.execute(new GetDeploymentCaseDefinitionCmd(caseDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
@SuppressWarnings("unchecked") protected <T extends TypedValue> T getCaseExecutionVariableTyped(String caseExecutionId, String variableName, boolean isLocal, boolean deserializeValue) { try { return (T) commandExecutor.execute(new GetCaseExecutionVariableTypedCmd(caseExecutionId, variableName, isLocal, deserializeValue)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseExecutionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public DecisionDefinition getDecisionDefinition(String decisionDefinitionId) { try { return commandExecutor.execute(new GetDeploymentDecisionDefinitionCmd(decisionDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (DecisionDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public CaseDefinition getCaseDefinition(String caseDefinitionId) { try { return commandExecutor.execute(new GetDeploymentCaseDefinitionCmd(caseDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (CaseDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public DecisionDefinition getDecisionDefinition(String decisionDefinitionId) { try { return commandExecutor.execute(new GetDeploymentDecisionDefinitionCmd(decisionDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (DecisionDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public DecisionRequirementsDefinition getDecisionRequirementsDefinition(String decisionRequirementsDefinitionId) { try { return commandExecutor.execute(new GetDeploymentDecisionRequirementsDefinitionCmd(decisionRequirementsDefinitionId)); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } catch (DecisionDefinitionNotFoundException e) { throw new NotFoundException(e.getMessage(), e); } }
public void deleteJob() { try { engine.getManagementService() .deleteJob(jobId); } catch (AuthorizationException e) { throw e; } catch (NullValueException e) { throw new InvalidRequestException(Status.NOT_FOUND, e.getMessage()); } catch (ProcessEngineException e) { throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage()); } }
public void testSetRetriesNullTaskId() { try { externalTaskService.setRetries((String)null, 5); fail("expected exception"); } catch (NullValueException e) { Assert.assertThat(e.getMessage(), containsString("externalTaskId is null")); } }