use of io.kubernetes.client.proto.Resource.Quantity in project seldon-core by SeldonIO.
the class JsonFormatTest method testQuantityCustomFormat.
@Test
public void testQuantityCustomFormat() throws InvalidProtocolBufferException {
final String val = "100Mi";
Quantity q = Quantity.newBuilder().setString(val).build();
Printer jf = JsonFormat.printer().usingTypeConverter(q.getDescriptorForType().getFullName(), new QuantityUtils.QuantityConverter());
Assert.assertTrue(jf.print(q).equals("\"" + val + "\""));
}
Aggregations