Skip to content

Commit

Permalink
Fixed the junit test case
Browse files Browse the repository at this point in the history
Signed-off-by: dhanendra06 <dhanendra.tech@gmail.com>
  • Loading branch information
dhanendra06 committed Feb 10, 2025
1 parent 81a89ec commit affabd7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import io.mosip.registration.processor.rest.client.utils.RestApiClient;
import io.mosip.registration.processor.status.service.impl.InternalAuthDelegateServiceImpl;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

@RunWith(SpringJUnit4ClassRunner.class)
public class InternalAuthDelegateServiceImplTest {
Expand All @@ -52,8 +53,7 @@ public class InternalAuthDelegateServiceImplTest {
@Mock
RestTemplate restTemplate;

@MockBean
@Qualifier("selfTokenWebClient")
@Mock
private WebClient webClient;

@Mock
Expand Down Expand Up @@ -84,6 +84,7 @@ public void setup() throws Exception {
ResponseEntity<AuthResponseDTO> entity = new ResponseEntity<AuthResponseDTO>(authResponse, HttpStatus.OK);
Mockito.when(restApiClient.getRestTemplate()).thenReturn(restTemplate);
Mockito.when(restTemplate.exchange(anyString(), any(), any(), eq(AuthResponseDTO.class))).thenReturn(entity);
Mockito.when(webClient.post().uri(anyString()).body(any()).retrieve().bodyToMono(AuthResponseDTO.class)).thenReturn(Mono.just(authResponse));
Mockito.when(mapper.writeValueAsString(any())).thenReturn("");
Mockito.when(mapper.readValue(anyString(), eq(IndividualIdDto.class))).thenReturn(individualIdDto);
}
Expand Down

0 comments on commit affabd7

Please sign in to comment.