* Affected Issue(s): #611 What this commit has achieved: 1. MDM requires an implementation of `INicknameSvc`, it was instantiated in `NicknameServiceConfig` The error message regarding this was: ``` APPLICATION FAILED TO START Description: Parameter 2 of method matcherFactory in ca.uhn.fhir.jpa.mdm.config.MdmCommonConfig required a bean of type 'ca.uhn.fhir.jpa.nickname.INicknameSvc' that could not be found. Action: Consider defining a bean of type 'ca.uhn.fhir.jpa.nickname.INicknameSvc' in your configuration. ``` 2. MDM requires the subscription of type message The error message regarding this was: ``` 2023-12-01 11:34:03 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mdmSubmitterInterceptorLoader': Invocation of init method failed; nested exception is ca.uhn.fhir.context.ConfigurationException: HAPI-2421: MDM requires Message Subscriptions to be enabled in the Storage Settings ``` * Affected Issue(s): #611 What this commit has achieved: 1. Added Integration Test for future-proof
30 lines
933 B
Java
30 lines
933 B
Java
package ca.uhn.fhir.jpa.starter;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
|
import ca.uhn.fhir.jpa.nickname.INicknameSvc;
|
|
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class}, properties = {
|
|
"hapi.fhir.fhir_version=r4",
|
|
"hapi.fhir.mdm_enabled=true"
|
|
})
|
|
class MdmTest {
|
|
@Autowired
|
|
INicknameSvc nicknameService;
|
|
|
|
@Autowired
|
|
JpaStorageSettings jpaStorageSettings;
|
|
|
|
@Test
|
|
void testApplicationStartedSuccessfully() {
|
|
assertThat(nicknameService).isNotNull();
|
|
assertThat(jpaStorageSettings.getSupportedSubscriptionTypes()).contains(SubscriptionChannelType.MESSAGE);
|
|
}
|
|
}
|