use of com.navercorp.pinpoint.grpc.trace.PAnnotationValue in project pinpoint by naver.
the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_IntString.
@Test
public void buildPAnnotationValue_IntString() {
IntStringValue intStringValue = new IntStringValue(1, "2");
PAnnotationValue container = mapper.buildPAnnotationValue(Annotations.of(1, intStringValue));
PIntStringValue pAnnotation = container.getIntStringValue();
Assert.assertEquals(pAnnotation.getIntValue(), 1);
Assert.assertEquals(pAnnotation.getStringValue().getValue(), "2");
}
use of com.navercorp.pinpoint.grpc.trace.PAnnotationValue in project pinpoint by naver.
the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_primitive.
@Test
public void buildPAnnotationValue_primitive() {
PAnnotationValue value = mapper.buildPAnnotationValue(Annotations.of(1, "foo"));
assertEquals("foo", value.getStringValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Integer.MAX_VALUE));
assertEquals(Integer.MAX_VALUE, value.getIntValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, value.getLongValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Boolean.TRUE));
assertEquals(Boolean.TRUE, value.getBoolValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Byte.MAX_VALUE));
assertEquals(Byte.MAX_VALUE, value.getByteValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Float.MAX_VALUE));
assertEquals(Float.MAX_VALUE, value.getDoubleValue(), 0);
value = mapper.buildPAnnotationValue(Annotations.of(1, Double.MAX_VALUE));
assertEquals(Double.MAX_VALUE, value.getDoubleValue(), 0);
value = mapper.buildPAnnotationValue(Annotations.of(1, "foo".getBytes()));
assertEquals(ByteString.copyFrom("foo".getBytes()), value.getBinaryValue());
value = mapper.buildPAnnotationValue(Annotations.of(1, Short.MAX_VALUE));
assertEquals(Short.MAX_VALUE, value.getShortValue());
}
Aggregations