Skip to content

Commit

Permalink
Move RetryUtilsTest to langchain4j-core with RetryUtils. (langchain4j…
Browse files Browse the repository at this point in the history
  • Loading branch information
crutcher authored Jan 9, 2024
1 parent 23b676f commit 4a7d14c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class RetryUtilsTest {

@Test
void testSuccessfulCall() throws Exception {
@SuppressWarnings("unchecked")
Callable<String> mockAction = mock(Callable.class);
when(mockAction.call()).thenReturn("Success");

Expand All @@ -25,6 +26,7 @@ void testSuccessfulCall() throws Exception {

@Test
void testRetryThenSuccess() throws Exception {
@SuppressWarnings("unchecked")
Callable<String> mockAction = mock(Callable.class);
when(mockAction.call())
.thenThrow(new RuntimeException())
Expand All @@ -46,6 +48,7 @@ void testRetryThenSuccess() throws Exception {

@Test
void testMaxAttemptsReached() throws Exception {
@SuppressWarnings("unchecked")
Callable<String> mockAction = mock(Callable.class);
when(mockAction.call()).thenThrow(new RuntimeException());

Expand Down

0 comments on commit 4a7d14c

Please sign in to comment.