use of com.google.protobuf.Type in project grpc-java by grpc.
the class ProtoUtilsTest method testJsonInvalid.
@Ignore("https://github.com/google/protobuf/issues/1470")
@Test
public void testJsonInvalid() throws Exception {
Marshaller<Type> marshaller = ProtoUtils.jsonMarshaller(Type.getDefaultInstance());
try {
marshaller.parse(new ByteArrayInputStream("{]".getBytes("UTF-8")));
fail("Expected exception");
} catch (StatusRuntimeException ex) {
assertEquals(Status.Code.INTERNAL, ex.getStatus().getCode());
assertNotNull(ex.getCause());
}
}
Aggregations