replay(mockSignature);
}
@Test
public void testMonitor() throws Throwable {
ProceedingJoinPoint mockPjp = createPjpMock(mockSignature, 2);
expect(mockPjp.proceed()).andReturn(null).times(2);
replay(mockPjp);
// Test monitor without pre-existing circuit breaker.
aspect.monitor(mockPjp, mockAnnotation);
// Test monitor with pre-existing circuit breaker.
aspect.monitor(mockPjp, mockAnnotation);
String otherName = "OtherMonitor";
ProceedingJoinPoint otherMockPjp = createPjpMock(mockSignature, 1);
expect(otherMockPjp.proceed()).andReturn(null).times(1);
replay(otherMockPjp);
CircuitBreaker otherMockAnnotation = createMock(CircuitBreaker.class);
expect(otherMockAnnotation.name()).andReturn(otherName).anyTimes();
expect(otherMockAnnotation.limit()).andReturn(5).anyTimes();