use of io.spine.test.client.TestEntityId in project core-java by SpineEventEngine.
the class TopicFactoryShould method create_topic_for_some_entities_of_kind.
@Test
public void create_topic_for_some_entities_of_kind() {
final Set<TestEntityId> ids = newHashSet(entityId(1), entityId(2), entityId(3));
final Topic topic = factory().topic().someOf(TARGET_ENTITY_CLASS, ids);
verifyTargetAndContext(topic);
final List<EntityId> actualIds = topic.getTarget().getFilters().getIdFilter().getIdsList();
assertEquals(ids.size(), actualIds.size());
for (EntityId actualId : actualIds) {
final Any rawId = actualId.getId();
final TestEntityId unpackedId = AnyPacker.unpack(rawId);
assertTrue(ids.contains(unpackedId));
}
}
use of io.spine.test.client.TestEntityId in project core-java by SpineEventEngine.
the class QueryFactoryShould method verifyIdFilter.
private static void verifyIdFilter(Set<TestEntityId> expectedIds, EntityFilters filters) {
assertNotNull(filters);
final EntityIdFilter idFilter = filters.getIdFilter();
assertNotNull(idFilter);
final List<EntityId> actualListOfIds = idFilter.getIdsList();
for (TestEntityId testEntityId : expectedIds) {
final EntityId expectedEntityId = EntityId.newBuilder().setId(AnyPacker.pack(testEntityId)).build();
assertTrue(actualListOfIds.contains(expectedEntityId));
}
}
Aggregations