### Question:
PnfCheckInputs implements JavaDelegate { @Override public void execute(DelegateExecution execution) { validatePnfCorrelationId(execution); validatePnfUuid(execution); validateTimeout(execution); validateServiceInstanceId(execution); } @Autowired  PnfCheckInputs(@Value("${aai.pnfEntryNotificationTimeout}") String pnfEntryNotificationTimeout); @Override void execute(DelegateExecution execution); static final String UUID_REGEX; }### Answer:
@Test public void shouldThrowException_whenPnfCorrelationIdNotSet() { PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT); DelegateExecution execution = delegateExecutionBuilder.setPnfCorrelationId(null).setPnfUuid(VALID_UUID).build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenPnfEntryNotificationTimeoutIsNull() { PnfCheckInputs testedObject = new PnfCheckInputs(null); DelegateExecution execution = delegateExecutionBuilder.build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenPnfEntryNotificationTimeoutIsEmpty() { PnfCheckInputs testedObject = new PnfCheckInputs(StringUtils.EMPTY); DelegateExecution execution = delegateExecutionBuilder.build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenPnfUuidIsNotSet() { PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT); DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(null).build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenPnfUuidIsEmptyString() { PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT); DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(StringUtils.EMPTY).build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenPnfUuidIsReservedUuid() { PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT); DelegateExecution execution = delegateExecutionBuilder.setPnfUuid(RESERVED_UUID).build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }
@Test public void shouldThrowException_whenServiceInstanceIdIsNotSet() { PnfCheckInputs testedObject = new PnfCheckInputs(PNF_ENTRY_NOTIFICATION_TIMEOUT); DelegateExecution execution = delegateExecutionBuilder.setServiceInstanceId(null).build(); assertThatThrownBy(() -> testedObject.execute(execution)).isInstanceOf(BpmnError.class); }