@Test public void testNormal() { // given TimerNameCache timerNameCache = new TimerNameCache(); // when TimerName timerName = timerNameCache.getName(C.class); // then assertThat(((TimerNameImpl) timerName).name()).isEqualTo("z"); }
@Test public void testClassWithoutPointcutAnnotation() { // given TimerNameCache timerNameCache = new TimerNameCache(); // when TimerName timerName = timerNameCache.getName(A.class); // then assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }
@Test public void testClassWithEmptyTimerName() { // given TimerNameCache timerNameCache = new TimerNameCache(); // when TimerName timerName = timerNameCache.getName(B.class); // then assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }
@Test public void testNullClass() { // given TimerNameCache timerNameCache = new TimerNameCache(); // when TimerName timerName = timerNameCache.getName(null); // then assertThat(((TimerNameImpl) timerName).name()).isEqualTo("unknown"); }