### Question:
UpdatePnfEntryInAai implements JavaDelegate { @Override public void execute(DelegateExecution execution) throws Exception { String pnfCorrelationId = String.valueOf(execution.getVariable(PNF_CORRELATION_ID)); Optional<Pnf> pnfAaiEntry = pnfManagement.getEntryFor(pnfCorrelationId); if (!pnfAaiEntry.isPresent()) { exceptionUtil.buildAndThrowWorkflowException(execution, 404, "AAI entry for PNF: " + PNF_CORRELATION_ID + " does not exist"); } Pnf pnf = pnfAaiEntry.get(); String pnfSoftwareVersion = String.valueOf(execution.getVariable(PRC_TARGET_SOFTWARE_VERSION)); pnf.setSwVersion(pnfSoftwareVersion); pnfManagement.updateEntry(pnfCorrelationId, pnf); logger.debug("AAI entry is updated for pnf correlation id: {}, pnf uuid: {} with swVersion: {}", pnf.getPnfName(), pnfCorrelationId, pnfSoftwareVersion); }  @Override void execute(DelegateExecution execution);  }### Answer:
@Test public void shouldSetSwVersion() throws Exception { setupPnf(); setupExecution(); updatePnfEntryInAai.execute(execution); Optional<Pnf> modifiedEntry = pnfManagementTest.getEntryFor("testPnfCorrelationId"); assertNotNull(modifiedEntry.get()); assertThat(modifiedEntry.get().getPnfId()).isEqualTo("testtest"); assertThat(modifiedEntry.get().getPnfName()).isEqualTo("testPnfCorrelationId"); assertThat(modifiedEntry.get().getSwVersion()).isEqualTo("demo-1.2"); verify(pnfManagementTest, times(2)).getEntryFor(anyString()); }