Search in sources :

Example 16 with ProjectId

use of io.spine.test.aggregate.ProjectId in project core-java by SpineEventEngine.

the class SubscriptionRecordShould method fail_to_match_improper_target.

@Test
public void fail_to_match_improper_target() {
    final ProjectId nonExistingId = ProjectId.newBuilder().setId("never-existed").build();
    final SubscriptionRecord notMatchingRecord = new SubscriptionRecord(Given.subscription(), Given.target(nonExistingId), Given.TYPE);
    final Project entityState = Project.getDefaultInstance();
    final Any wrappedState = AnyPacker.pack(entityState);
    final ProjectId redundantId = ProjectId.getDefaultInstance();
    final boolean matchResult = notMatchingRecord.matches(Given.TYPE, redundantId, wrappedState);
    assertFalse(matchResult);
}
Also used : Project(io.spine.test.aggregate.Project) ProjectId(io.spine.test.aggregate.ProjectId) Any(com.google.protobuf.Any) Test(org.junit.Test)

Aggregations

ProjectId (io.spine.test.aggregate.ProjectId)16 Test (org.junit.Test)12 Any (com.google.protobuf.Any)3 Project (io.spine.test.aggregate.Project)3 Message (com.google.protobuf.Message)2 Subscription (io.spine.client.Subscription)2 SubscriptionUpdate (io.spine.client.SubscriptionUpdate)2 Target (io.spine.client.Target)2 Topic (io.spine.client.Topic)2 AbstractVersionableEntity (io.spine.server.entity.AbstractVersionableEntity)2 VersionableEntity (io.spine.server.entity.VersionableEntity)2 Before (org.junit.Before)2 Response (io.spine.base.Response)1 CommandEnvelope (io.spine.envelope.CommandEnvelope)1 ProjectDefinition (io.spine.test.aggregate.ProjectDefinition)1 ImportEvents (io.spine.test.aggregate.command.ImportEvents)1