assertThatThrownBy(() -> testedObject.execute(delegateExecution)).isInstanceOf(BpmnError.class);
}
+ @Test
+ public void shouldThrowException_whenPnfIdIsEmptyString() throws Exception {
+ // given
+ PnfCheckInputs testedObject = new PnfCheckInputs(DEFAULT_TIMEOUT);
+ DelegateExecution delegateExecution = mockDelegateExecution();
+ when(delegateExecution.getVariable(CORRELATION_ID)).thenReturn("");
+ // when, then
+ assertThatThrownBy(() -> testedObject.execute(delegateExecution)).isInstanceOf(BpmnError.class);
+ }
+
private DelegateExecution mockDelegateExecutionWithCorrelationId() {
new PnfCheckInputs(DEFAULT_TIMEOUT);
DelegateExecution delegateExecution = mockDelegateExecution();
assertThatThrownBy(() -> testedObject.execute(delegateExecution)).isInstanceOf(BpmnError.class);
}
+ @Test
+ public void shouldThrowException_whenTimeoutIsEmptyStringAndDefaultIsNotDefined() throws Exception {
+ // given
+ PnfCheckInputs testedObject = new PnfCheckInputs(null);
+ DelegateExecution delegateExecution = mockDelegateExecutionWithCorrelationId();
+ when(delegateExecution.getVariable(TIMEOUT_FOR_NOTIFICATION)).thenReturn("");
+ // when, then
+ assertThatThrownBy(() -> testedObject.execute(delegateExecution)).isInstanceOf(BpmnError.class);
+ }
+
@Test
public void shouldSetDefaultTimeout_whenTimeoutIsNotSet() {
// given
// then
verify(delegateExecution).setVariable(eq(TIMEOUT_FOR_NOTIFICATION), eq(DEFAULT_TIMEOUT));
}
-}
\ No newline at end of file
+}