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

MAT-7471: Disable auto-encoding on FhirTerminologyServiceWebClient #97

Merged
merged 1 commit into from
Jul 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ public ValueSetSearchResult searchValueSets(String apiKey, Map<String, String> q
}
log.info("valueSetList {}", valueSetList);
});
return ValueSetSearchResult.builder().valueSets(valueSetList).resultBundle(responseString).build();
return ValueSetSearchResult.builder()
.valueSets(valueSetList)
.resultBundle(responseString)
.build();
}

public List<CodeSystem> getAllCodeSystems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.DefaultUriBuilderFactory;
import org.springframework.web.util.UriComponentsBuilder;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -42,9 +43,12 @@ public FhirTerminologyServiceWebClient(
@Value("${client.fhir-terminology-service.code-lookups}") String codeLookupsUrl,
@Value("${client.default_profile}") String defaultProfile,
@Value("${client.search_value_set_endpoint}") String searchValueSetEndpoint) {
DefaultUriBuilderFactory uriBuilderFactory =
new DefaultUriBuilderFactory(fhirTerminologyServiceBaseUrl);
uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE);
fhirTerminologyWebClient =
WebClient.builder()
.baseUrl(fhirTerminologyServiceBaseUrl)
.uriBuilderFactory(uriBuilderFactory)
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.codecs(
clientCodecConfigurer -> clientCodecConfigurer.defaultCodecs().maxInMemorySize(-1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ void testSearchValueSets() {
Principal principal = mock(Principal.class);
when(principal.getName()).thenReturn(TEST_USER);
when(vsacService.verifyUmlsAccess(anyString())).thenReturn(umlsUser);
when(fhirTerminologyService.searchValueSets(any(), any())).thenReturn(ValueSetSearchResult.builder().valueSets(mockValueSets).build());
when(fhirTerminologyService.searchValueSets(any(), any()))
.thenReturn(ValueSetSearchResult.builder().valueSets(mockValueSets).build());
Map<String, String> queryParams = new HashMap<>();
queryParams.put("param1", "value1");
queryParams.put("param2", "value2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.client.WebClientResponseException;
Expand All @@ -31,7 +30,7 @@ class FhirTerminologyServiceWebClientTest {

private ValueSetsSearchCriteria.ValueSetParams testValueSetParams;

@InjectMocks FhirTerminologyServiceWebClient fhirTerminologyServiceWebClient;
FhirTerminologyServiceWebClient fhirTerminologyServiceWebClient;

@BeforeAll
static void setUp() throws IOException {
Expand Down
Loading