Search in sources :

Example 1 with NullCallback

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())));
}
Also used : NullCallback(com.bedatadriven.rebar.async.NullCallback) GetSchema(org.activityinfo.legacy.shared.command.GetSchema) Test(org.junit.Test)

Aggregations

NullCallback (com.bedatadriven.rebar.async.NullCallback)1 GetSchema (org.activityinfo.legacy.shared.command.GetSchema)1 Test (org.junit.Test)1