Got subscription stuff working again

This commit is contained in:
jkv
2020-09-08 23:46:42 +02:00
parent 5eef970fbe
commit 7d79d5d8b5
6 changed files with 36 additions and 29 deletions

View File

@@ -36,8 +36,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class, properties =
{
"spring.batch.job.enabled=false",
"spring.profiles.active=r5",
"spring.datasource.url=jdbc:h2:mem:dbr5",
"spring.profiles.active=r4",
"spring.datasource.url=jdbc:h2:mem:dbr4",
"hapi.fhir.subscription.websocket_enabled=true",
"hapi.fhir.empi_enabled=true"
})

View File

@@ -1,5 +1,9 @@
package ca.uhn.fhir.jpa.starter;
import static ca.uhn.fhir.util.TestUtil.waitForSize;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.api.CacheControlDirective;
import ca.uhn.fhir.rest.api.EncodingEnum;
@@ -7,9 +11,9 @@ import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.test.utilities.JettyUtil;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import java.net.URI;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
@@ -20,8 +24,6 @@ import org.hl7.fhir.r5.model.Observation;
import org.hl7.fhir.r5.model.Patient;
import org.hl7.fhir.r5.model.Subscription;
import org.hl7.fhir.r5.model.SubscriptionTopic;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -29,15 +31,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.net.URI;
import java.nio.file.Paths;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import static ca.uhn.fhir.util.TestUtil.waitForSize;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class, properties =
{

View File

@@ -24,8 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
"spring.profiles.active=r4",
"spring.datasource.url=jdbc:h2:mem:dbr4-mt",
"hapi.fhir.subscription.websocket_enabled=true",
"hapi.fhir.subscription.websocket_enabled=true",
"hapi.fhir.partitioning_multitenancy_enabled"
"hapi.fhir.partitioning.partitioning_include_in_search_hashes=false"
})
public class MultitenantServerR4IT {
@@ -96,6 +95,7 @@ public class MultitenantServerR4IT {
@BeforeEach
void beforeEach() {
ourClientTenantInterceptor = new UrlTenantSelectionInterceptor();
ourCtx = FhirContext.forR4();
ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
ourCtx.getRestfulClientFactory().setSocketTimeout(1200 * 1000);