use of com.hazelcast.jet.protobuf.Messages.Animal in project hazelcast by hazelcast.
the class JobSerializerTest method when_serializerIsRegisteredWithTheHook_then_itIsAvailableForTheJob.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void when_serializerIsRegisteredWithTheHook_then_itIsAvailableForTheJob() {
String listName = "list-3";
Pipeline pipeline = Pipeline.create();
pipeline.readFrom(TestSources.items("Mustang")).map(name -> Animal.newBuilder().setName(name).build()).writeTo(Sinks.list(listName));
client().getJet().newJob(pipeline, new JobConfig()).join();
// Protocol Buffer types implement Serializable, to make sure hook registered serializer is used we check the
// type id
ClientListProxy<Animal> proxy = ((ClientListProxy) client().getList(listName));
assertThat(proxy.dataSubList(0, 1).get(0).getType()).isEqualTo(ANIMAL_TYPE_ID);
}
Aggregations