コード例 #1
0
  @Test
  public void givenAlreadyAddedAspectWhenWithOtherAspectThenShouldRegister() {
    context.withAspect(AnAspect.class);
    context.withAspect(OtherAspect.class);

    verify(weaverMock).registerAspect(OtherAspect.class);
  }
コード例 #2
0
  @Test
  public void whenWithAspectMultipleTimesThenShouldNotResetAndShouldRegisterEveryAspect() {
    context.withAspect(AnAspect.class);
    context.withAspect(OtherAspect.class);

    verify(weaverMock, times(2)).registerAspect((Class<?>) anyObject());
    verifyNoMoreInteractions(weaverMock);
  }
コード例 #3
0
  @Test
  public void whenWithAspectShouldRegisterTheAspectOnTheWeaver() {
    Class<?> theAspect = AnAspect.class;
    context.withAspect(theAspect);

    verify(weaverMock).registerAspect(theAspect);
  }