use of com.bedatadriven.rebar.async.NullCallback in project activityinfo by bedatadriven.
the class CommandRequestTest method equalCommandsShouldBeMerged.
@Test
public void equalCommandsShouldBeMerged() {
assumeThat(new GetSchema(), is(equalTo(new GetSchema())));
CommandRequest firstCommand = new CommandRequest(new GetSchema(), new NullCallback());
List<CommandRequest> pending = Collections.singletonList(firstCommand);
CommandRequest secondRequest = new CommandRequest(new GetSchema(), new NullCallback());
boolean merged = secondRequest.mergeSuccessfulInto(pending);
assertThat("merged", merged, is(true));
assertThat(firstCommand.getCallbacks(), hasItem(first(secondRequest.getCallbacks())));
}
Aggregations