@Test public void testActivityArgsUntouchedWhenActivityArgsExistsButNoAdditionalInfo() { PdlLogMessage logMessage = testee.populateLogMessage( buildPdlLogMessage(ACTIVITY_ARGS), buildLogRequest(""), buildLogUser()); assertEquals(ACTIVITY_ARGS, logMessage.getActivityArgs()); }
@Override public PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser) { populateWithCurrentUserAndCareUnit(logMessage, logUser); PdlResource pdlResource = new PdlResource(); pdlResource.setPatient(createPatient(logRequest)); pdlResource.setResourceOwner(createEnhet(logRequest)); pdlResource.setResourceType(ResourceType.RESOURCE_TYPE_INTYG.getResourceTypeName()); logMessage.getPdlResourceList().add(pdlResource); logMessage.setSystemId(systemId); logMessage.setSystemName(systemName); logMessage.setTimestamp(LocalDateTime.now()); logMessage.setPurpose(ActivityPurpose.CARE_TREATMENT); populateActivityArgsWithAdditionalInformationIfApplicable(logMessage, logRequest); unsetValues(logMessage); return logMessage; }
LogMessagePopulatorImpl implements LogMessagePopulator { @Override public PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser) { populateWithCurrentUserAndCareUnit(logMessage, logUser); PdlResource pdlResource = new PdlResource(); pdlResource.setPatient(createPatient(logRequest)); pdlResource.setResourceOwner(createEnhet(logRequest)); pdlResource.setResourceType(ResourceType.RESOURCE_TYPE_INTYG.getResourceTypeName()); logMessage.getPdlResourceList().add(pdlResource); logMessage.setSystemId(systemId); logMessage.setSystemName(systemName); logMessage.setTimestamp(LocalDateTime.now()); logMessage.setPurpose(ActivityPurpose.CARE_TREATMENT); populateActivityArgsWithAdditionalInformationIfApplicable(logMessage, logRequest); unsetValues(logMessage); return logMessage; } }
LogMessagePopulatorImpl implements LogMessagePopulator { @Override public PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser) { populateWithCurrentUserAndCareUnit(logMessage, logUser); PdlResource pdlResource = new PdlResource(); pdlResource.setPatient(createPatient(logRequest)); pdlResource.setResourceOwner(createEnhet(logRequest)); pdlResource.setResourceType(ResourceType.RESOURCE_TYPE_INTYG.getResourceTypeName()); logMessage.getPdlResourceList().add(pdlResource); logMessage.setSystemId(systemId); logMessage.setSystemName(systemName); logMessage.setTimestamp(LocalDateTime.now()); logMessage.setPurpose(ActivityPurpose.CARE_TREATMENT); populateActivityArgsWithAdditionalInformationIfApplicable(logMessage, logRequest); unsetValues(logMessage); return logMessage; }  }
LogMessagePopulatorImpl implements LogMessagePopulator { @Override public PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser) { populateWithCurrentUserAndCareUnit(logMessage, logUser); PdlResource pdlResource = new PdlResource(); pdlResource.setPatient(createPatient(logRequest)); pdlResource.setResourceOwner(createEnhet(logRequest)); pdlResource.setResourceType(ResourceType.RESOURCE_TYPE_INTYG.getResourceTypeName()); logMessage.getPdlResourceList().add(pdlResource); logMessage.setSystemId(systemId); logMessage.setSystemName(systemName); logMessage.setTimestamp(LocalDateTime.now()); logMessage.setPurpose(ActivityPurpose.CARE_TREATMENT); populateActivityArgsWithAdditionalInformationIfApplicable(logMessage, logRequest); unsetValues(logMessage); return logMessage; }  @Override PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser); }
LogMessagePopulatorImpl implements LogMessagePopulator { @Override public PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser) { populateWithCurrentUserAndCareUnit(logMessage, logUser); PdlResource pdlResource = new PdlResource(); pdlResource.setPatient(createPatient(logRequest)); pdlResource.setResourceOwner(createEnhet(logRequest)); pdlResource.setResourceType(ResourceType.RESOURCE_TYPE_INTYG.getResourceTypeName()); logMessage.getPdlResourceList().add(pdlResource); logMessage.setSystemId(systemId); logMessage.setSystemName(systemName); logMessage.setTimestamp(LocalDateTime.now()); logMessage.setPurpose(ActivityPurpose.CARE_TREATMENT); populateActivityArgsWithAdditionalInformationIfApplicable(logMessage, logRequest); unsetValues(logMessage); return logMessage; }  @Override PdlLogMessage populateLogMessage(PdlLogMessage logMessage, LogRequest logRequest, LogUser logUser);  }