Search in sources :

Example 1 with TestFeignDecorator

use of io.github.resilience4j.feign.test.TestFeignDecorator in project resilience4j by resilience4j.

the class DecoratorInvocationHandlerTest method setUp.

@Before
public void setUp() throws Throwable {
    target = new HardCodedTarget<TestService>(TestService.class, TestService.class.getSimpleName());
    testService = new TestServiceImpl();
    greetingMethod = testService.getClass().getDeclaredMethod("greeting");
    feignDecorator = new TestFeignDecorator();
    methodHandler = mock(MethodHandler.class);
    when(methodHandler.invoke(any())).thenReturn(testService.greeting());
    dispatch = new HashMap<>();
    dispatch.put(greetingMethod, methodHandler);
    testSubject = new DecoratorInvocationHandler(target, dispatch, feignDecorator);
}
Also used : MethodHandler(feign.InvocationHandlerFactory.MethodHandler) TestService(io.github.resilience4j.feign.test.TestService) TestFeignDecorator(io.github.resilience4j.feign.test.TestFeignDecorator) TestServiceImpl(io.github.resilience4j.feign.test.TestServiceImpl) Before(org.junit.Before)

Aggregations

MethodHandler (feign.InvocationHandlerFactory.MethodHandler)1 TestFeignDecorator (io.github.resilience4j.feign.test.TestFeignDecorator)1 TestService (io.github.resilience4j.feign.test.TestService)1 TestServiceImpl (io.github.resilience4j.feign.test.TestServiceImpl)1 Before (org.junit.Before)1