InboundCommand extends AbstractCommand { public void changeStatus(final Status status) { final Long timestamp = new Date().getTime(); if(status.equals(Status.COMPLETED)) { this.setCompletedTimestamp(timestamp); } else if(status.equals(Status.FAILED)) { this.setFailedTimestamp(timestamp); } this.setStatus(status); } InboundCommand();  InboundCommand(String subject, String source, String destination, String GTX, String LTX, String FLTX, String PGTX, String additionalHeaders, String payload, Status status, String refId, String traceId);  InboundCommand( String subject, String source, String destination, String GTX, String LTX, String FLTX, String PGTX, String additionalHeaders, String payload, Status status, String traceId); static InboundCommandBuilder builder(); Status getStatus(); void setStatus(Status status); void changeStatus(final Status status); void changeStatusToCompleted(); void changeStatusToFailed(); Long getCompletedTimestamp(); void setCompletedTimestamp(Long completedTimestamp); String getRefId(); void setRefId(String refId);  }
@Test public void testChangeStatusWithFailed() { inboundCommandUnderTest.changeStatus(Status.FAILED); verify(inboundCommandUnderTest).changeStatus(any(Status.class)); assertThat(inboundCommandUnderTest.getFailedTimestamp()).isNotNull(); }