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

[refactor] move code from MonitorsController to MonitorService #2415

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

pwallk
Copy link
Contributor

@pwallk pwallk commented Jul 30, 2024

What's changed?

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

when(monitorDao.findAll(specification, PageRequest.of(1, 1))).thenReturn(Page.empty());
assertNotNull(monitorService.getMonitors(specification, PageRequest.of(1, 1)));
doReturn(Page.empty()).when(monitorDao).findAll(any(Specification.class), any(PageRequest.class));
assertNotNull(monitorService.getMonitors(null, null, null, null, null, null, null, 1, 1, null));
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems this test case is not match param list of getMonitors. Some params have a default value.

};
// Pagination is a must
order = order == null ? "desc" : order;
sort = sort == null ? "gmtCreate" : sort;
Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines can be removed once you correct your test case to match param list.

Copy link
Contributor

@Calvin979 Calvin979 left a comment

Choose a reason for hiding this comment

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

lgtm!

@Calvin979 Calvin979 merged commit 181ca5a into apache:master Jul 31, 2024
3 checks passed
@pwallk pwallk deleted the reactor-MonitorsController branch August 1, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants