use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project incubator-servicecomb-java-chassis by apache.
the class TestRepeatedSchema method users.
@Test
public void users() throws Throwable {
builder.addUsers(ProtobufRoot.User.newBuilder().setName("name1").build());
builder.addUsers(ProtobufRoot.User.newBuilder().setName("name2").build());
check();
RootWithArray rootWithArray = new RootWithArray();
rootWithArray.users = new User[] { new User("name1"), new User("name2") };
Assert.assertArrayEquals(protobufBytes, rootSerializer.serialize(rootWithArray));
}
use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project incubator-servicecomb-java-chassis by apache.
the class TestBytesSchema method type_invalid.
@Test
public void type_invalid() throws Throwable {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("not support serialize from org.apache.servicecomb.foundation.protobuf.internal.model.User to proto bytes, field=org.apache.servicecomb.foundation.protobuf.internal.model.Root:bytes"));
scbMap = new HashMap<>();
scbMap.put("bytes", new User());
rootSerializer.serialize(scbMap);
}
Aggregations