Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ public static final class GetAll extends EndpointInput {
static final String LOCATION_MASK_QUERY_PARAMETER = "location-mask";
static final String DESIGNATOR_MASK_QUERY_PARAMETER = "designator-mask";
static final String SOURCE_ENTITY_QUERY_PARAMETER = "source-entity";
static final String SOURCE_ENTITY_LIKE_QUERY_PARAMETER = "source-entity-like";
private String officeId;
private String specIdMask;
private String locationIdMask;
private String designatorMask;
private String sourceEntityId;
private String sourceEntityLike;


private GetAll() {
Expand Down Expand Up @@ -126,13 +128,19 @@ public ForecastSpecEndpointInput.GetAll sourceEntityId(String sourceEntityId) {
return this;
}

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

@Override
protected HttpRequestBuilder addInputParameters(HttpRequestBuilder httpRequestBuilder) {
return httpRequestBuilder.addQueryParameter(ID_MASK_QUERY_PARAMETER, specIdMask)
.addQueryParameter(OFFICE_QUERY_PARAMETER, officeId)
.addQueryParameter(LOCATION_MASK_QUERY_PARAMETER, locationIdMask)
.addQueryParameter(DESIGNATOR_MASK_QUERY_PARAMETER, designatorMask)
.addQueryParameter(SOURCE_ENTITY_QUERY_PARAMETER, sourceEntityId)
.addQueryParameter(SOURCE_ENTITY_LIKE_QUERY_PARAMETER, sourceEntityLike)
.addQueryHeader(ACCEPT_QUERY_HEADER, ACCEPT_HEADER_V2);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ void testGetAllQueryRequest() {
.specIdMask("test-spec")
.designatorMask("designator")
.sourceEntityId("source-entity")
.locationIdMask("location");
.locationIdMask("location")
.sourceEntityLike("%");
input.addInputParameters(mockHttpRequestBuilder);
assertEquals("SWT", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.OFFICE_QUERY_PARAMETER));
assertEquals("test-spec", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.ID_MASK_QUERY_PARAMETER));
assertEquals("designator", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.DESIGNATOR_MASK_QUERY_PARAMETER));
assertEquals("source-entity", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.SOURCE_ENTITY_QUERY_PARAMETER));
assertEquals("location", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.LOCATION_MASK_QUERY_PARAMETER));
assertEquals("%", mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.SOURCE_ENTITY_LIKE_QUERY_PARAMETER));
assertEquals(ACCEPT_HEADER_V2, mockHttpRequestBuilder.getQueryHeader(ACCEPT_QUERY_HEADER));
}

Expand All @@ -74,6 +76,7 @@ void testGetAllQueryRequestDefaults() {
assertNull(mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.DESIGNATOR_MASK_QUERY_PARAMETER));
assertNull(mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.SOURCE_ENTITY_QUERY_PARAMETER));
assertNull(mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.LOCATION_MASK_QUERY_PARAMETER));
assertNull(mockHttpRequestBuilder.getQueryParameter(ForecastSpecEndpointInput.GetAll.SOURCE_ENTITY_LIKE_QUERY_PARAMETER));
assertEquals(ACCEPT_HEADER_V2, mockHttpRequestBuilder.getQueryHeader(ACCEPT_QUERY_HEADER));
}

Expand Down
Loading