Skip to content

Feature amit unit test case#1

Open
amit-kumaryadav wants to merge 2 commits into
hubNotifier-devfrom
feature-amit-unitTestCase
Open

Feature amit unit test case#1
amit-kumaryadav wants to merge 2 commits into
hubNotifier-devfrom
feature-amit-unitTestCase

Conversation

@amit-kumaryadav

Copy link
Copy Markdown
Collaborator

No description provided.

@vjtarento vjtarento left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please go through with the code again and don't mock the impl classes. As discussed, please try to get the code coverage above 70%. Please call me for any clarification.

assertTrue(entity.getStatusCode().equals(HttpStatus.INTERNAL_SERVER_ERROR));
when(configuration.getNotifyServiceHost()).thenReturn(NOTIFICATION_SERVICE_HOST);
when(configuration.getNotifyServicePath()).thenReturn(NOTIFICATION_SERVICE_PATH);
doNothing().when(notifyHandlerServiceImpl).sendNotification(notificationEvent);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please look into this again. using this code it will not do any operation when notifyHandlerServiceImpl class will be called.

List<HubUser> userList = new ArrayList<>();
userList.add(user);
when(userRepository.findByUUIDS(Arrays.asList("1", "2"))).thenReturn(userList);
doNothing().when(notifyHookService).handleTopicUpvoteEvent(Matchers.any(Map.class));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please look into this again. using this code it will not do any operation when notifyHookService class will be called.

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