Fix ExampleServerR4IT, restrict config to specific tests
This commit is contained in:
@@ -33,6 +33,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.util.TestPropertyValues;
|
import org.springframework.boot.test.util.TestPropertyValues;
|
||||||
import org.springframework.boot.web.server.LocalServerPort;
|
import org.springframework.boot.web.server.LocalServerPort;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
RepositoryConfig.class
|
RepositoryConfig.class
|
||||||
}, properties =
|
}, properties =
|
||||||
{
|
{
|
||||||
|
"spring.profiles.include=storageSettingsTest",
|
||||||
"spring.datasource.url=jdbc:h2:mem:dbr3",
|
"spring.datasource.url=jdbc:h2:mem:dbr3",
|
||||||
"hapi.fhir.cr_enabled=true",
|
"hapi.fhir.cr_enabled=true",
|
||||||
"hapi.fhir.fhir_version=dstu3",
|
"hapi.fhir.fhir_version=dstu3",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package ca.uhn.fhir.jpa.starter;
|
package ca.uhn.fhir.jpa.starter;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.cr.config.RepositoryConfig;
|
||||||
import ca.uhn.fhir.jpa.searchparam.config.NicknameServiceConfig;
|
import ca.uhn.fhir.jpa.searchparam.config.NicknameServiceConfig;
|
||||||
import ca.uhn.fhir.rest.api.CacheControlDirective;
|
import ca.uhn.fhir.rest.api.CacheControlDirective;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
@@ -31,7 +32,14 @@ import static org.awaitility.Awaitility.await;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class, NicknameServiceConfig.class}, properties = {
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
|
||||||
|
classes = {
|
||||||
|
Application.class,
|
||||||
|
JpaStarterWebsocketDispatcherConfig.class,
|
||||||
|
NicknameServiceConfig.class,
|
||||||
|
RepositoryConfig.class
|
||||||
|
}, properties = {
|
||||||
|
"spring.profiles.include=storageSettingsTest",
|
||||||
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
||||||
"hapi.fhir.enable_repository_validating_interceptor=true",
|
"hapi.fhir.enable_repository_validating_interceptor=true",
|
||||||
"hapi.fhir.fhir_version=r4",
|
"hapi.fhir.fhir_version=r4",
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package ca.uhn.fhir.jpa.starter;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
||||||
|
import org.hl7.fhir.dstu2.model.Subscription;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
|
||||||
|
@Profile("storageSettingsTest")
|
||||||
|
@Configuration
|
||||||
|
public class JpaStorageSettingsConfig {
|
||||||
|
@Primary
|
||||||
|
@Bean
|
||||||
|
public JpaStorageSettings storageSettings() {
|
||||||
|
JpaStorageSettings retVal = new JpaStorageSettings();
|
||||||
|
|
||||||
|
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.WEBSOCKET);
|
||||||
|
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.MESSAGE);
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user