LiveCommandAnswerFactory { @Nonnull public static LiveCommandAnswer newLiveCommandAnswer(@Nullable final CommandResponse<?> commandResponse) { return ImmutableLiveCommandAnswer.newInstance(commandResponse, null); } private  LiveCommandAnswerFactory(); @Nonnull static LiveCommandAnswer newLiveCommandAnswer(@Nullable final CommandResponse<?> commandResponse); @Nonnull static LiveCommandAnswer newLiveCommandAnswer(@Nullable final Event<?> event); @Nonnull static LiveCommandAnswer newLiveCommandAnswer(@Nullable final CommandResponse<?> commandResponse,
            @Nullable final Event<?> event);  }
@Test public void getLiveCommandAnswerInstanceWithCommandResponseOnly() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer(commandResponseMock); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasResponse(commandResponseMock) .hasNoEvent(); }
@Test public void getLiveCommandAnswerInstanceWithNullCommandResponse() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer((CommandResponse) null); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasNoResponse() .hasNoEvent(); }
@Test public void getLiveCommandAnswerInstanceWithEventOnly() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer(eventMock); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasNoResponse() .hasEvent(eventMock); }
@Test public void getLiveCommandAnswerInstanceWithNullEvent() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer((Event) null); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasNoResponse() .hasNoEvent(); }
@Test public void getLiveCommandAnswerInstanceWithCommandResponseAndEvent() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer(commandResponseMock, eventMock); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasResponse(commandResponseMock) .hasEvent(eventMock); }
@Test public void getLiveCommandAnswerInstanceWithNullCommandResponseAndNullEvent() { final LiveCommandAnswer liveCommandAnswer = LiveCommandAnswerFactory.newLiveCommandAnswer((CommandResponse) null, (Event) null); LiveCommandAssertions.assertThat(liveCommandAnswer) .hasNoResponse() .hasNoEvent(); }