ProcessStatus { @Override public String toString() { return "ProductionStatus{" + "state=" + state + ", message='" + message + '\'' + ", progress=" + progress + '}'; } ProcessStatus(ProcessState state);  ProcessStatus(ProcessState state, float progress);  ProcessStatus(ProcessState state, float progress, String message); static ProcessStatus aggregate(ProcessStatus... statuses); ProcessState getState(); boolean isDone(); String getMessage(); float getProgress(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ProcessStatus aggregateUnsustainable(ProcessStatus... statuses); final static ProcessStatus UNKNOWN; final static ProcessStatus SCHEDULED; }
@Test public void testToString() { assertEquals("ProductionStatus{state=RUNNING, message='Dabei!', progress=0.2}", new ProcessStatus(ProcessState.RUNNING, 0.2f, "Dabei!").toString()); assertEquals("ProductionStatus{state=CANCELLED, message='Go away', progress=0.1}", new ProcessStatus(ProcessState.CANCELLED, 0.1f, "Go away").toString()); assertEquals("ProductionStatus{state=COMPLETED, message='This was hard', progress=1.0}", new ProcessStatus(ProcessState.COMPLETED, 1.0f, "This was hard").toString()); assertEquals("ProductionStatus{state=ERROR, message='I/O problem', progress=0.8}", new ProcessStatus(ProcessState.ERROR, 0.8f, "I/O problem").toString()); }