From 30ec3e282d37108c5ae46eb4ba67c1c9aa7ab62d Mon Sep 17 00:00:00 2001 From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com> Date: Wed, 4 Nov 2026 07:46:12 +0800 Subject: [PATCH] Point VocabularyServiceIT at the source-keyed vocabulary endpoints --- .../org/ohdsi/webapi/test/VocabularyServiceIT.java | 12 ++++++++---- src/test/resources/application-test.properties | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java b/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java index e69ba2ee7e..f9866e7555 100644 --- a/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java +++ b/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java @@ -39,6 +39,10 @@ public void init() throws Exception { addConcept(); } + private String withSourceKey(String endpoint) { + return endpoint.replace("{sourceKey}", SOURCE_KEY); + } + private void addConcept() { String resultSql = SqlRender.renderSql(ResourceHelper.GetResourceAsString(CONCEPT_FILE_PATH), new String[]{"cdm_database_schema"}, new String[]{CDM_SCHEMA_NAME}); @@ -50,7 +54,7 @@ private void addConcept() { public void canGetConcept() { //Action - final ResponseEntity entity = getRestTemplate().getForEntity(this.endpointConcept, String.class); + final ResponseEntity entity = getRestTemplate().getForEntity(withSourceKey(this.endpointConcept), String.class); //Assertion assertOK(entity); @@ -60,7 +64,7 @@ public void canGetConcept() { public void canGetVocabularies() { //Action - final ResponseEntity entity = getRestTemplate().getForEntity(this.endpointVocabularies, String.class); + final ResponseEntity entity = getRestTemplate().getForEntity(withSourceKey(this.endpointVocabularies), String.class); //Assertion assertOK(entity); @@ -70,7 +74,7 @@ public void canGetVocabularies() { public void canGetDomains() { //Action - final ResponseEntity entity = getRestTemplate().getForEntity(this.endpointDomains, String.class); + final ResponseEntity entity = getRestTemplate().getForEntity(withSourceKey(this.endpointDomains), String.class); //Assertion assertOK(entity); @@ -79,7 +83,7 @@ public void canGetDomains() { @Test public void canSearchConceptsWithQueryParam() { // Test the GET /{sourceKey}/search?query=... endpoint format - String searchUrl = this.endpointSearch.replace("{sourceKey}", SOURCE_KEY) + "?query=test"; + String searchUrl = withSourceKey(this.endpointSearch) + "?query=test"; //Action final ResponseEntity entity = getRestTemplate().getForEntity(searchUrl, String.class); diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index bedec4dbc3..a7137eeced 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -3,11 +3,11 @@ security.auth.db.datasource.url=http://localhost:${datasource.url}/arachne_porta vocabularyservice.endpoint=${baseUri}/vocabulary cdmResultsService.endpoint=${baseUri}/cdmresults #GET vocabularies -vocabularyservice.endpoint.vocabularies=${vocabularyservice.endpoint}/vocabularies +vocabularyservice.endpoint.vocabularies=${vocabularyservice.endpoint}/{sourceKey}/vocabularies #GET domains -vocabularyservice.endpoint.domains=${vocabularyservice.endpoint}/domains +vocabularyservice.endpoint.domains=${vocabularyservice.endpoint}/{sourceKey}/domains #GET concept -vocabularyservice.endpoint.concept=${vocabularyservice.endpoint}/concept/1 +vocabularyservice.endpoint.concept=${vocabularyservice.endpoint}/{sourceKey}/concept/1 #GET search with query param vocabularyservice.endpoint.search=${vocabularyservice.endpoint}/{sourceKey}/search #GET cohortdefinitions