@Test(dataProvider = "envVarProvider") public void testSetEnvVars(boolean setAgendaProgress) { agenda = makeAgenda(); setupJsonHelperResponses(setAgendaProgress); executionConfigurator.setEnvVars( agenda, setAgendaProgress ? agendaProgress : null); SoftAssertions.assertSoftly(softly -> { softly.assertThat(executionConfig.getEnvVars().get(HandlerField.CID.name())).isEqualTo(cid); softly.assertThat(executionConfig.getEnvVars().get(HandlerField.PAYLOAD.name())).isEqualTo(payload); softly.assertThat(executionConfig.getEnvVars().get(HandlerField.AGENDA_ID.name())).isEqualTo(agendaId); softly.assertThat(executionConfig.getEnvVars().get(HandlerField.CUSTOMER_ID.name())).isEqualTo(customerId); softly.assertThat(executionConfig.getEnvVars().get(HandlerField.PROGRESS_ID.name())).isEqualTo(progressId); if(setAgendaProgress) softly.assertThat(executionConfig.getEnvVars().get(HandlerField.LAST_PROGRESS.name())).isEqualTo(progressPayload); else softly.assertThat(executionConfig.getEnvVars().get(HandlerField.LAST_PROGRESS.name())).isNull(); }); }
public void setEnvVars(Agenda agenda, AgendaProgress agendaProgress) { agendaId = agenda.getId(); String payload = jsonHelper.getJSONString(agenda); String progressPayload = agendaProgress == null ? null : jsonHelper.getJSONString(agendaProgress); logger.debug("Launching Executor with Payload: {}", payload); payloadWriter.writePayload(payload); if(progressPayload != null) setEnvVar(HandlerField.LAST_PROGRESS.name(), progressPayload); setEnvVar(HandlerField.CID.name(), agenda.getCid()); setEnvVar(HandlerField.AGENDA_ID.name(), agenda.getId()); setEnvVar(HandlerField.CUSTOMER_ID.name(), agenda.getCustomerId()); setEnvVar(HandlerField.PROGRESS_ID.name(), agenda.getProgressId()); }
ExecutionAgendaConfigurator { public void setEnvVars(Agenda agenda, AgendaProgress agendaProgress) { agendaId = agenda.getId(); String payload = jsonHelper.getJSONString(agenda); String progressPayload = agendaProgress == null ? null : jsonHelper.getJSONString(agendaProgress); logger.debug("Launching Executor with Payload: {}", payload); payloadWriter.writePayload(payload); if(progressPayload != null) setEnvVar(HandlerField.LAST_PROGRESS.name(), progressPayload); setEnvVar(HandlerField.CID.name(), agenda.getCid()); setEnvVar(HandlerField.AGENDA_ID.name(), agenda.getId()); setEnvVar(HandlerField.CUSTOMER_ID.name(), agenda.getCustomerId()); setEnvVar(HandlerField.PROGRESS_ID.name(), agenda.getProgressId()); } }
ExecutionAgendaConfigurator { public void setEnvVars(Agenda agenda, AgendaProgress agendaProgress) { agendaId = agenda.getId(); String payload = jsonHelper.getJSONString(agenda); String progressPayload = agendaProgress == null ? null : jsonHelper.getJSONString(agendaProgress); logger.debug("Launching Executor with Payload: {}", payload); payloadWriter.writePayload(payload); if(progressPayload != null) setEnvVar(HandlerField.LAST_PROGRESS.name(), progressPayload); setEnvVar(HandlerField.CID.name(), agenda.getCid()); setEnvVar(HandlerField.AGENDA_ID.name(), agenda.getId()); setEnvVar(HandlerField.CUSTOMER_ID.name(), agenda.getCustomerId()); setEnvVar(HandlerField.PROGRESS_ID.name(), agenda.getProgressId()); } ExecutionAgendaConfigurator(ExecutionConfig executionConfig, JsonHelper jsonHelper, PayloadWriter payloadWriter); }
ExecutionAgendaConfigurator { public void setEnvVars(Agenda agenda, AgendaProgress agendaProgress) { agendaId = agenda.getId(); String payload = jsonHelper.getJSONString(agenda); String progressPayload = agendaProgress == null ? null : jsonHelper.getJSONString(agendaProgress); logger.debug("Launching Executor with Payload: {}", payload); payloadWriter.writePayload(payload); if(progressPayload != null) setEnvVar(HandlerField.LAST_PROGRESS.name(), progressPayload); setEnvVar(HandlerField.CID.name(), agenda.getCid()); setEnvVar(HandlerField.AGENDA_ID.name(), agenda.getId()); setEnvVar(HandlerField.CUSTOMER_ID.name(), agenda.getCustomerId()); setEnvVar(HandlerField.PROGRESS_ID.name(), agenda.getProgressId()); } ExecutionAgendaConfigurator(ExecutionConfig executionConfig, JsonHelper jsonHelper, PayloadWriter payloadWriter); void setEnvVars(Agenda agenda, AgendaProgress agendaProgress); void setPayloadWriter(PayloadWriter payloadWriter); }
ExecutionAgendaConfigurator { public void setEnvVars(Agenda agenda, AgendaProgress agendaProgress) { agendaId = agenda.getId(); String payload = jsonHelper.getJSONString(agenda); String progressPayload = agendaProgress == null ? null : jsonHelper.getJSONString(agendaProgress); logger.debug("Launching Executor with Payload: {}", payload); payloadWriter.writePayload(payload); if(progressPayload != null) setEnvVar(HandlerField.LAST_PROGRESS.name(), progressPayload); setEnvVar(HandlerField.CID.name(), agenda.getCid()); setEnvVar(HandlerField.AGENDA_ID.name(), agenda.getId()); setEnvVar(HandlerField.CUSTOMER_ID.name(), agenda.getCustomerId()); setEnvVar(HandlerField.PROGRESS_ID.name(), agenda.getProgressId()); } ExecutionAgendaConfigurator(ExecutionConfig executionConfig, JsonHelper jsonHelper, PayloadWriter payloadWriter); void setEnvVars(Agenda agenda, AgendaProgress agendaProgress); void setPayloadWriter(PayloadWriter payloadWriter);  }