Search in sources :

Example 36 with TypeUrl

use of io.spine.type.TypeUrl in project core-java by SpineEventEngine.

the class StandShould method checkHasExactlyOne.

private static void checkHasExactlyOne(Set<TypeUrl> availableTypes, Descriptors.Descriptor expectedType) {
    assertEquals(1, availableTypes.size());
    final TypeUrl actualTypeUrl = availableTypes.iterator().next();
    final TypeUrl expectedTypeUrl = TypeUrl.from(expectedType);
    assertEquals("Type was registered incorrectly", expectedTypeUrl, actualTypeUrl);
}
Also used : TypeUrl(io.spine.type.TypeUrl)

Example 37 with TypeUrl

use of io.spine.type.TypeUrl in project core-java by SpineEventEngine.

the class QueriesShould method return_proper_type_for_known_target.

@Test
public void return_proper_type_for_known_target() {
    final Target target = Targets.allOf(TestEntity.class);
    final Query query = Query.newBuilder().setTarget(target).build();
    final TypeUrl type = Queries.typeOf(query);
    assertNotNull(type);
    assertEquals(TARGET_ENTITY_TYPE_URL, type.toString());
}
Also used : TypeUrl(io.spine.type.TypeUrl) Test(org.junit.Test)

Aggregations

TypeUrl (io.spine.type.TypeUrl)37 Any (com.google.protobuf.Any)12 Test (org.junit.Test)11 EntityRecord (io.spine.server.entity.EntityRecord)7 Message (com.google.protobuf.Message)6 StandStorage (io.spine.server.stand.StandStorage)4 EntityRecordWithColumns (io.spine.server.entity.storage.EntityRecordWithColumns)3 ClassName (io.spine.type.ClassName)3 TypeName (io.spine.type.TypeName)3 Descriptors (com.google.protobuf.Descriptors)2 Version (io.spine.base.Version)2 Query (io.spine.client.Query)2 BoundedContext (io.spine.server.BoundedContext)2 StandTestProjectionRepository (io.spine.server.stand.Given.StandTestProjectionRepository)2 TenantAwareTest (io.spine.server.tenant.TenantAwareTest)2 Customer (io.spine.test.commandservice.customer.Customer)2 CustomerId (io.spine.test.commandservice.customer.CustomerId)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Maps.newHashMap (com.google.common.collect.Maps.newHashMap)1 CanIgnoreReturnValue (com.google.errorprone.annotations.CanIgnoreReturnValue)1