WinderTaskInput extends ParametersMap<Object> implements TaskInput { @Override public String toJson() { try { return JsonUtil.writeValueAsString(this); } catch (IOException e) { log.warn("Convert to json exception", e); throw new IllegalStateException("Illegal state"); } } WinderTaskInput();  WinderTaskInput(Class jobClass);  WinderTaskInput(Map<String, Object> map); @Override String getJobType(); void setJobType(String jobType); @Override String getJobOwner(); @Override void setJobOwner(String jobOwner); @Override int getStepInterval(); void setStepInterval(int stepInterval); @Override int getJobDuration(); void setJobDuration(int jobDuration); @Override Date getJobScheduleTime(); @Override boolean isStraightforward(); @Override String toJson(); void setJobScheduleTime(Date jobScheduleTime); @Override Class getJobClass(); void setJobClass(Class jobClass); String getJobGroup(); void setJobGroup(String jobGroup); void setStraightforward(boolean straightforward);  }
@Test public void toJson() throws Exception { WinderTaskInput input = new WinderTaskInput(); input.setJobType("type"); assertEquals("type", input.getJobType()); input.setJobGroup("category"); assertEquals("category", input.getJobGroup()); input.setJobOwner("owner"); assertEquals("owner", input.getJobOwner()); input.setStepInterval(10000); assertEquals(10000, input.getStepInterval()); input.getJobScheduleTime(); input.setJobScheduleTime(new Date()); input.put("test", "abc"); assertTrue(input.toJson().contains("\"test\":\"abc\"")); }