use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class JsonShould method print_to_json.
@Test
public void print_to_json() {
final StringValue value = Wrapper.forString("print_to_json");
assertFalse(toJson(value).isEmpty());
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class AnyPackerShould method have_unpacking_func.
@Test
public void have_unpacking_func() {
final StringValue value = newUuidValue();
assertEquals(value, AnyPacker.unpackFunc().apply(Any.pack(value)));
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class AnyPackerShould method unpack_google_message_from_Any.
@Test
public void unpack_google_message_from_Any() {
final Any any = Any.pack(googleMsg);
final StringValue actual = AnyPacker.unpack(any);
assertEquals(googleMsg, actual);
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class WrappersShould method format.
@Test
public void format() {
final StringValue str = Wrappers.format("%d %d %d", 1, 2, 3);
assertEquals(str.getValue(), "1 2 3");
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class RecordBasedRepositoryShould method find_entities_by_query.
@Test
public void find_entities_by_query() {
final I id1 = createId(271);
final I id2 = createId(314);
final Class<E> entityClass = repository.getEntityClass();
final E entity1 = Given.entityOfClass(entityClass).withId(id1).build();
final E entity2 = Given.entityOfClass(entityClass).withId(id2).build();
repository.store(entity1);
repository.store(entity2);
final String fieldPath = "idString";
final StringValue fieldValue = StringValue.newBuilder().setValue(id1.toString()).build();
final EntityFilters filters = EntityFilters.newBuilder().putColumnFilter(fieldPath, AnyPacker.pack(fieldValue)).build();
final Collection<E> found = repository.find(filters, FieldMask.getDefaultInstance());
assertSize(1, found);
assertContains(entity1, found);
assertNotContains(entity2, found);
}
Aggregations