use of org.apache.cassandra.tracing.Tracing.TraceType in project cassandra by apache.
the class MessageTest method testBuilder.
@Test
public void testBuilder() {
long id = 1;
InetAddressAndPort from = FBUtilities.getLocalAddressAndPort();
long createAtNanos = approxTime.now();
long expiresAtNanos = createAtNanos + TimeUnit.SECONDS.toNanos(1);
TraceType traceType = TraceType.QUERY;
UUID traceSession = UUID.randomUUID();
Message<NoPayload> msg = Message.builder(Verb._TEST_1, noPayload).withId(1).from(from).withCreatedAt(createAtNanos).withExpiresAt(expiresAtNanos).withFlag(MessageFlag.CALL_BACK_ON_FAILURE).withParam(TRACE_TYPE, TraceType.QUERY).withParam(TRACE_SESSION, traceSession).build();
assertEquals(id, msg.id());
assertEquals(from, msg.from());
assertEquals(createAtNanos, msg.createdAtNanos());
assertEquals(expiresAtNanos, msg.expiresAtNanos());
assertTrue(msg.callBackOnFailure());
assertFalse(msg.trackRepairedData());
assertEquals(traceType, msg.traceType());
assertEquals(traceSession, msg.traceSession());
assertNull(msg.forwardTo());
assertNull(msg.respondTo());
}
Aggregations