Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-39680 fix junit test case #2021

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

kaledOu
Copy link

@kaledOu kaledOu commented Mar 6, 2025

No description provided.

@kaledOu kaledOu force-pushed the develop-MOSIP-39680 branch from 1b98647 to cf2ff95 Compare March 6, 2025 14:27
Comment on lines 82 to 86


WebClient.RequestBodyUriSpec requestBodyUriSpec = Mockito.mock(WebClient.RequestBodyUriSpec.class);
WebClient.RequestHeadersSpec requestHeadersSpec = Mockito.mock(WebClient.RequestHeadersSpec.class);
WebClient.ResponseSpec responseSpec = Mockito.mock(WebClient.ResponseSpec.class);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaledOu Can we remove these and define above with @mock annotation. Example:
@mock
private WebClient webClient;
@mock
private WebClient.RequestBodySpec requestBodySpec;
@mock
private WebClient.RequestBodyUriSpec requestBodyUriSpec;
@mock
private WebClient.ResponseSpec responseSpec;

Comment on lines 93 to 99
AuthResponseDTO mockResponse = new AuthResponseDTO();
ResponseDTO responseDTO = new ResponseDTO();
responseDTO.setAuthStatus(true);
mockResponse.setResponse(responseDTO);

Mockito.when(responseSpec.bodyToMono(AuthResponseDTO.class))
.thenReturn(Mono.just(mockResponse));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaledOu Do we need to create the new object as it is already there as "authResponse" object. Can we check on this.

Signed-off-by: kaledOu <[email protected]>

authResponse.setResponse(responseDto);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: kaledOu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants