use of com.ctrip.framework.apollo.tracer.internals.NullTransaction in project apollo by ctripcorp.
the class TracerTest method testNewTransactionWithException.
@Test
public void testNewTransactionWithException() throws Exception {
String someType = "someType";
String someName = "someName";
when(someProducer.newTransaction(someType, someName)).thenThrow(RuntimeException.class);
Transaction result = Tracer.newTransaction(someType, someName);
verify(someProducer, times(1)).newTransaction(someType, someName);
assertTrue(result instanceof NullTransaction);
}
Aggregations