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

CWMSVue 594 - Updated LocationGroup GetAll Endpoint parameters #238

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/coveragereport/badge_methodcoverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public static final class GetAll extends EndpointInput {
private String officeId;
private boolean includeAssigned = false;
private String categoryIdMask;
private String categoryOfficeId;

private GetAll() {

Expand All @@ -112,6 +113,11 @@ public GetAll officeId(String officeId) {
return this;
}

public GetAll categoryOfficeId(String categoryOfficeId) {
this.categoryOfficeId = categoryOfficeId;
return this;
}

public GetAll includeAssigned(boolean includeAssigned) {
this.includeAssigned = includeAssigned;
return this;
Expand All @@ -127,6 +133,7 @@ protected HttpRequestBuilder addInputParameters(HttpRequestBuilder httpRequestBu
return httpRequestBuilder.addQueryParameter(OFFICE_QUERY_PARAMETER, officeId)
.addQueryParameter(INCLUDE_ASSIGNED_QUERY_PARAMETER, Boolean.toString(includeAssigned))
.addQueryParameter(CATEGORY_ID_LIKE_QUERY_PARAMETER, categoryIdMask)
.addQueryParameter(CATEGORY_OFFICE_ID_QUERY_PARAMETER, categoryOfficeId)
.addQueryHeader(ACCEPT_QUERY_HEADER, ACCEPT_HEADER_JSON);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ void testGetAll() {
LocationGroupEndpointInput.GetAll input = LocationGroupEndpointInput.getAll()
.officeId("SWT")
.includeAssigned(true)
.categoryIdMask("Default");
.categoryIdMask("Default")
.categoryOfficeId("SWT");
input.addInputParameters(mockHttpRequestBuilder);
assertEquals("SWT", mockHttpRequestBuilder.getQueryParameter(OFFICE_QUERY_PARAMETER));
assertEquals("true", mockHttpRequestBuilder.getQueryParameter(INCLUDE_ASSIGNED_QUERY_PARAMETER));
assertEquals("Default", mockHttpRequestBuilder.getQueryParameter(CATEGORY_ID_LIKE_QUERY_PARAMETER));
assertNull(mockHttpRequestBuilder.getQueryParameter(CATEGORY_ID_QUERY_PARAMETER));
assertEquals("SWT", mockHttpRequestBuilder.getQueryParameter(CATEGORY_OFFICE_ID_QUERY_PARAMETER));
assertEquals(ACCEPT_HEADER_JSON, mockHttpRequestBuilder.getQueryHeader(ACCEPT_QUERY_HEADER));
}

Expand Down