Search in sources :

Example 6 with BulkWriteOperation

use of io.spine.server.projection.BulkWriteOperation in project core-java by SpineEventEngine.

the class BulkWriteOperationShould method fail_to_complete_twice.

@Test(expected = IllegalStateException.class)
public void fail_to_complete_twice() {
    final BulkWriteOperation operation = newOperation();
    assertTrue(operation.isInProgress());
    operation.complete();
    assertFalse(operation.isInProgress());
    operation.complete();
}
Also used : BulkWriteOperation(io.spine.server.projection.BulkWriteOperation) Test(org.junit.Test)

Example 7 with BulkWriteOperation

use of io.spine.server.projection.BulkWriteOperation in project core-java by SpineEventEngine.

the class BulkWriteOperationShould method do_nothing_if_checked_before_completion_time.

@Test
public void do_nothing_if_checked_before_completion_time() {
    final BulkWriteOperation operation = newOperation();
    assertTrue(operation.isInProgress());
    operation.checkExpiration();
    assertTrue(operation.isInProgress());
}
Also used : BulkWriteOperation(io.spine.server.projection.BulkWriteOperation) Test(org.junit.Test)

Example 8 with BulkWriteOperation

use of io.spine.server.projection.BulkWriteOperation in project core-java by SpineEventEngine.

the class BulkWriteOperationShould method exit_silently_if_cheked_after_completion.

@Test
public void exit_silently_if_cheked_after_completion() {
    final BulkWriteOperation operation = newOperation();
    operation.complete();
    assertFalse(operation.isInProgress());
    operation.checkExpiration();
    assertFalse(operation.isInProgress());
}
Also used : BulkWriteOperation(io.spine.server.projection.BulkWriteOperation) Test(org.junit.Test)

Example 9 with BulkWriteOperation

use of io.spine.server.projection.BulkWriteOperation in project core-java by SpineEventEngine.

the class BulkWriteOperationShould method initialize_with_proper_delay_and_callback.

@Test
public void initialize_with_proper_delay_and_callback() {
    final Duration duration = Durations2.seconds(60);
    final BulkWriteOperation operation = new BulkWriteOperation<>(duration, new EmptyCallback());
    assertNotNull(operation);
}
Also used : BulkWriteOperation(io.spine.server.projection.BulkWriteOperation) Duration(com.google.protobuf.Duration) Test(org.junit.Test)

Aggregations

BulkWriteOperation (io.spine.server.projection.BulkWriteOperation)9 Test (org.junit.Test)7 Duration (com.google.protobuf.Duration)4 Timestamp (com.google.protobuf.Timestamp)1 FlushCallback (io.spine.server.projection.BulkWriteOperation.FlushCallback)1 Collections.emptySet (java.util.Collections.emptySet)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1