Search in sources :

Example 46 with StringValue

use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.

the class ProcessManagerShould method create_iterating_router.

@Test
public void create_iterating_router() {
    final StringValue commandMessage = Wrapper.forString("create_iterating_router");
    final CommandContext commandContext = requestFactory.createCommandContext();
    processManager.setCommandBus(mock(CommandBus.class));
    final IteratingCommandRouter router = processManager.newIteratingRouterFor(commandMessage, commandContext);
    assertNotNull(router);
    assertEquals(commandMessage, getMessage(router.getSource()));
    assertEquals(commandContext, router.getSource().getContext());
}
Also used : CommandContext(io.spine.base.CommandContext) CommandBus(io.spine.server.commandbus.CommandBus) StringValue(com.google.protobuf.StringValue) TenantAwareTest(io.spine.server.tenant.TenantAwareTest) Test(org.junit.Test)

Example 47 with StringValue

use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.

the class InvalidEventExceptionShould method create_exception_with_violations.

@Test
public void create_exception_with_violations() {
    final StringValue msg = Wrapper.forString("");
    final InvalidEventException exception = InvalidEventException.onConstraintViolations(msg, singletonList(ConstraintViolation.getDefaultInstance()));
    assertNotNull(exception.getMessage());
    assertNotNull(exception.getError());
    assertEquals(msg, exception.getEventMessage());
}
Also used : InvalidEventException(io.spine.server.event.InvalidEventException) StringValue(com.google.protobuf.StringValue) Test(org.junit.Test)

Aggregations

StringValue (com.google.protobuf.StringValue)47 Test (org.junit.Test)41 Command (io.spine.base.Command)7 Timestamp (com.google.protobuf.Timestamp)5 Any (com.google.protobuf.Any)4 Event (io.spine.base.Event)4 Identifiers.idToString (io.spine.base.Identifiers.idToString)4 Wrapper.forString (io.spine.protobuf.Wrapper.forString)4 TenantAwareTest (io.spine.server.tenant.TenantAwareTest)4 CommandContext (io.spine.base.CommandContext)3 EventFactory (io.spine.server.command.EventFactory)3 CommandBus (io.spine.server.commandbus.CommandBus)3 Version (io.spine.base.Version)2 EntityStateEnvelope (io.spine.server.entity.EntityStateEnvelope)2 TestActorRequestFactory (io.spine.test.TestActorRequestFactory)2 Before (org.junit.Before)2 EqualsTester (com.google.common.testing.EqualsTester)1 FieldMask (com.google.protobuf.FieldMask)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 Message (com.google.protobuf.Message)1