@Test void testGetParameterMapEmptyString() { ScriptJobExecution scriptJobExecution = mock(ScriptJobExecution.class); when(scriptJobExecution.getParameters()).thenReturn(null); when(scriptJobExecution.getIdValue()).thenReturn("scriptJobExecutionIdentifier"); Map<String, Object> actual = scheduledJobConfig.getParameterMap(scriptJobExecution); Map<String, Object> expected = new HashMap<>(); expected.put("scriptJobExecutionId", "scriptJobExecutionIdentifier"); assertEquals(expected, actual); }
Map<String, Object> getParameterMap(ScriptJobExecution scriptJobExecution) { Map<String, Object> params = new HashMap<>(); String parameterString = scriptJobExecution.getParameters(); if (!Strings.isNullOrEmpty(parameterString)) { params.putAll(gson.fromJson(parameterString, MAP_TOKEN)); } params.put("scriptJobExecutionId", scriptJobExecution.getIdValue()); return params; }
ScheduledScriptConfig { Map<String, Object> getParameterMap(ScriptJobExecution scriptJobExecution) { Map<String, Object> params = new HashMap<>(); String parameterString = scriptJobExecution.getParameters(); if (!Strings.isNullOrEmpty(parameterString)) { params.putAll(gson.fromJson(parameterString, MAP_TOKEN)); } params.put("scriptJobExecutionId", scriptJobExecution.getIdValue()); return params; } }
ScheduledScriptConfig { Map<String, Object> getParameterMap(ScriptJobExecution scriptJobExecution) { Map<String, Object> params = new HashMap<>(); String parameterString = scriptJobExecution.getParameters(); if (!Strings.isNullOrEmpty(parameterString)) { params.putAll(gson.fromJson(parameterString, MAP_TOKEN)); } params.put("scriptJobExecutionId", scriptJobExecution.getIdValue()); return params; } ScheduledScriptConfig(
      SavedScriptRunner savedScriptRunner,
      ScheduledJobTypeFactory scheduledJobTypeFactory,
      ScriptJobExecutionMetadata scriptJobExecutionMetadata,
      Gson gson); }
ScheduledScriptConfig { Map<String, Object> getParameterMap(ScriptJobExecution scriptJobExecution) { Map<String, Object> params = new HashMap<>(); String parameterString = scriptJobExecution.getParameters(); if (!Strings.isNullOrEmpty(parameterString)) { params.putAll(gson.fromJson(parameterString, MAP_TOKEN)); } params.put("scriptJobExecutionId", scriptJobExecution.getIdValue()); return params; } ScheduledScriptConfig(
      SavedScriptRunner savedScriptRunner,
      ScheduledJobTypeFactory scheduledJobTypeFactory,
      ScriptJobExecutionMetadata scriptJobExecutionMetadata,
      Gson gson); @Bean JobFactory<ScriptJobExecution> scriptJobFactory(); @Lazy @Bean ScheduledJobType scriptJobType(); }
ScheduledScriptConfig { Map<String, Object> getParameterMap(ScriptJobExecution scriptJobExecution) { Map<String, Object> params = new HashMap<>(); String parameterString = scriptJobExecution.getParameters(); if (!Strings.isNullOrEmpty(parameterString)) { params.putAll(gson.fromJson(parameterString, MAP_TOKEN)); } params.put("scriptJobExecutionId", scriptJobExecution.getIdValue()); return params; } ScheduledScriptConfig(
      SavedScriptRunner savedScriptRunner,
      ScheduledJobTypeFactory scheduledJobTypeFactory,
      ScriptJobExecutionMetadata scriptJobExecutionMetadata,
      Gson gson); @Bean JobFactory<ScriptJobExecution> scriptJobFactory(); @Lazy @Bean ScheduledJobType scriptJobType();  }