File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/com/intuit/springwebclient/retryHandler Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .intuit .springwebclient .retryHandler ;
2+
3+ import org .junit .jupiter .api .Assertions ;
4+ import org .junit .jupiter .api .Test ;
5+
6+ public class RetryHandlerFactoryTest {
7+
8+ @ Test
9+ public void testAddAndGetHandler () {
10+ String handlerTestName = "retryHandlerTestName1" ;
11+ RetryHandler retryHandler1 = new RetryHandler () {
12+
13+ @ Override
14+ public void checkAndThrowRetriableException (Exception ex ) {
15+ throw new RuntimeException ("test exception" );
16+ }
17+
18+ @ Override
19+ public String getName () {
20+ return "defaultHandlerName" ;
21+ }
22+
23+ };
24+
25+ RetryHandlerFactory .addHandler (handlerTestName , retryHandler1 );
26+
27+ Assertions .assertEquals (retryHandler1 , RetryHandlerFactory .getHandler (handlerTestName ));
28+ Assertions .assertEquals ("defaultHandlerName" , RetryHandlerFactory .getHandler (handlerTestName ).getName ());
29+ Assertions .assertNull (RetryHandlerFactory .getHandler ("retryHandlerTestName2" ));
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments