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

RAD-377: Search by report template license #498

Merged
merged 1 commit into from
Nov 22, 2016
Merged

Conversation

achabill
Copy link
Contributor

RAD-377: Search by report template license

Description

Provided a Java API + REST API for search of Mrrt report templates via the MrrtReportTemplate.dctermsLicense.

Related Issue

see https://issues.openmrs.org/browse/RAD-377

Checklist:

  • My pull request only contains one single commit.
  • My pull request is based on the latest master branch
    git pull --rebase upstream master.
  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.
  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.171% when pulling a9f38dd on achabill:RAD-377 into bb941ce on openmrs:master.

Copy link
Contributor

@ivange94 ivange94 left a comment

Choose a reason for hiding this comment

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

Looks good. Just handle the one comment I left

@Autowired
private MrrtReportTemplateService mrrtReportTemplateService;

SearchQuery searchQuery = new SearchQuery.Builder("Allows you to search for MrrtReportTemplate's by title")
.withOptionalParameters(new String[] { REQUEST_PARAM_TITLE, REQUEST_PARAM_PUBLISHER, REQUEST_PARAM_TOTAL_COUNT })
.withOptionalParameters(new String[] { REQUEST_PARAM_TITLE, REQUEST_PARAM_PUBLISHER, REQUEST_PARAM_TOTAL_COUNT,
REQUEST_PARAM_LICENSE })
.build();
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please put REQUEST_PARAM_TOTAL_COUNT at the end of the list?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.171% when pulling 2bc01e9 on achabill:RAD-377 into bb941ce on openmrs:master.

assertThat(templates.size(), is(1));
assertThat(templates.get(0)
.getDcTermsLicense(),
is("General Public License"));
Copy link
Member

Choose a reason for hiding this comment

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

why dont you use your constant EXISTING_TEMPLATE_LICENSE ?


assertNotNull(licenses);
assertThat(licenses.size(), is(2));
assertTrue(licenses.contains("Mozilla Public License"));
Copy link
Member

Choose a reason for hiding this comment

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

use your constants instead of the string literals and you should be able to use matchers that test that these two string constants are in the list without asserTrue.

@dkayiwa
Copy link
Member

dkayiwa commented Nov 15, 2016

@achabill are you still working on this?

@achabill
Copy link
Contributor Author

@dkayiwa, yes. I've been waiting for @teleivo to comment on this PR. I'll fix the requested changes today.

RAD-377: Request changes

RAD-377: Request changes PR openmrs#498

- using string constant
- List matchers without assertTrue
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.171% when pulling b032503 on achabill:RAD-377 into bb941ce on openmrs:master.

@teleivo teleivo merged commit f072080 into openmrs:master Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants