diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java index 7df3756abe8..8545b5f05cb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java @@ -6,8 +6,8 @@ import ca.uhn.fhir.interceptor.api.IInterceptorService; import ca.uhn.fhir.interceptor.executor.InterceptorService; import ca.uhn.fhir.jpa.binstore.BinaryAccessProvider; import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor; -import ca.uhn.fhir.jpa.bulk.BulkDataExportSvcImpl; import ca.uhn.fhir.jpa.bulk.BulkDataExportProvider; +import ca.uhn.fhir.jpa.bulk.BulkDataExportSvcImpl; import ca.uhn.fhir.jpa.bulk.IBulkDataExportSvc; import ca.uhn.fhir.jpa.dao.DaoRegistry; import ca.uhn.fhir.jpa.graphql.JpaStorageServices; @@ -28,8 +28,8 @@ import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc; import ca.uhn.fhir.jpa.search.reindex.ResourceReindexingSvcImpl; import ca.uhn.fhir.jpa.subscription.dbmatcher.CompositeInMemoryDaoSubscriptionMatcher; import ca.uhn.fhir.jpa.subscription.dbmatcher.DaoSubscriptionMatcher; -import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; import ca.uhn.fhir.jpa.subscription.module.cache.LinkedBlockingQueueSubscribableChannelFactory; +import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; import ca.uhn.fhir.jpa.subscription.module.matcher.ISubscriptionMatcher; import ca.uhn.fhir.jpa.subscription.module.matcher.InMemorySubscriptionMatcher; import ca.uhn.fhir.rest.server.interceptor.consent.IConsentContextServices; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionActivatingInterceptor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionActivatingInterceptor.java index e4c1294b34a..9a242ffe355 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionActivatingInterceptor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionActivatingInterceptor.java @@ -22,13 +22,13 @@ package ca.uhn.fhir.jpa.subscription; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.interceptor.api.Hook; +import ca.uhn.fhir.interceptor.api.Interceptor; +import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.jpa.config.BaseConfig; import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.dao.DaoRegistry; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; -import ca.uhn.fhir.interceptor.api.Hook; -import ca.uhn.fhir.interceptor.api.Interceptor; -import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.jpa.subscription.module.ResourceModifiedMessage; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionCanonicalizer; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionConstants; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionInterceptorLoader.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionInterceptorLoader.java index 65984fdd389..1e7e01934e5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionInterceptorLoader.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionInterceptorLoader.java @@ -20,8 +20,8 @@ package ca.uhn.fhir.jpa.subscription; * #L% */ -import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.interceptor.api.IInterceptorService; +import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionLoader; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionRegistry; import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelRegistry; @@ -71,7 +71,7 @@ public class SubscriptionInterceptorLoader { private void loadSubscriptions() { ourLog.info("Loading subscriptions into the SubscriptionRegistry..."); - // Activate scheduled subscription loads into the SubscriptionRegistry + // Load active subscriptions into the SubscriptionRegistry and activate their channels SubscriptionLoader loader = myApplicationContext.getBean(SubscriptionLoader.class); loader.syncSubscriptions(); ourLog.info("...{} subscriptions loaded", mySubscriptionRegistry.size()); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/SubscriptionTestUtil.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/SubscriptionTestUtil.java index 615f05d7049..bb3d30a6ce7 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/SubscriptionTestUtil.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/SubscriptionTestUtil.java @@ -5,7 +5,7 @@ import ca.uhn.fhir.jpa.subscription.module.LinkedBlockingQueueSubscribableChanne import ca.uhn.fhir.jpa.subscription.module.cache.ActiveSubscription; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionRegistry; import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelRegistry; -import ca.uhn.fhir.jpa.subscription.module.subscriber.email.IEmailSender; +import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelWithHandlers; import ca.uhn.fhir.jpa.subscription.module.subscriber.email.JavaMailEmailSender; import ca.uhn.fhir.jpa.subscription.module.subscriber.email.SubscriptionDeliveringEmailSubscriber; import org.hl7.fhir.dstu2.model.Subscription; @@ -79,7 +79,8 @@ public class SubscriptionTestUtil { public void setEmailSender(IIdType theIdElement) { ActiveSubscription activeSubscription = mySubscriptionRegistry.get(theIdElement.getIdPart()); - SubscriptionDeliveringEmailSubscriber subscriber = (SubscriptionDeliveringEmailSubscriber) mySubscriptionChannelRegistry.get(activeSubscription.getChannelName()).getDeliveryHandlerForUnitTest(); + SubscriptionChannelWithHandlers subscriptionChannelWithHandlers = mySubscriptionChannelRegistry.get(activeSubscription.getChannelName()); + SubscriptionDeliveringEmailSubscriber subscriber = (SubscriptionDeliveringEmailSubscriber) subscriptionChannelWithHandlers.getDeliveryHandlerForUnitTest(); subscriber.setEmailSender(myEmailSender); } diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/ActiveSubscription.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/ActiveSubscription.java index 50aa89dfbc6..5289910e437 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/ActiveSubscription.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/ActiveSubscription.java @@ -20,10 +20,8 @@ package ca.uhn.fhir.jpa.subscription.module.cache; * #L% */ -import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscriptionChannelType; -import org.hl7.fhir.instance.model.api.IIdType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/LinkedBlockingQueueSubscribableChannelFactory.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/LinkedBlockingQueueSubscribableChannelFactory.java index e6226ed765d..435bea071f6 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/LinkedBlockingQueueSubscribableChannelFactory.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/cache/LinkedBlockingQueueSubscribableChannelFactory.java @@ -21,8 +21,8 @@ package ca.uhn.fhir.jpa.subscription.module.cache; */ import ca.uhn.fhir.jpa.subscription.module.LinkedBlockingQueueSubscribableChannel; -import org.springframework.messaging.SubscribableChannel; import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; +import org.springframework.messaging.SubscribableChannel; import java.util.concurrent.LinkedBlockingQueue; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelCache.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelCache.java index 0596f339385..89a5236802f 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelCache.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelCache.java @@ -1,15 +1,10 @@ package ca.uhn.fhir.jpa.subscription.module.channel; -import ca.uhn.fhir.jpa.subscription.module.cache.ActiveSubscription; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionRegistry; -import com.google.common.collect.Multimap; -import com.google.common.collect.MultimapBuilder; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Collection; -import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -22,10 +17,6 @@ class SubscriptionChannelCache { return myCache.get(theChannelName); } - public Collection getAll() { - return Collections.unmodifiableCollection(myCache.values()); - } - public int size() { return myCache.size(); } @@ -34,7 +25,7 @@ class SubscriptionChannelCache { myCache.put(theChannelName, theValue); } - public synchronized void remove(String theChannelName) { + synchronized void closeAndRemove(String theChannelName) { Validate.notBlank(theChannelName); SubscriptionChannelWithHandlers subscriptionChannelWithHandlers = myCache.get(theChannelName); diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelFactory.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelFactory.java index 3ed3add830c..c4a53b8d696 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelFactory.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelFactory.java @@ -20,11 +20,8 @@ package ca.uhn.fhir.jpa.subscription.module.channel; * #L% */ -import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; -import org.springframework.messaging.SubscribableChannel; -import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; -import ca.uhn.fhir.jpa.subscription.module.channel.ISubscriptionDeliveryChannelNamer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.messaging.SubscribableChannel; import org.springframework.stereotype.Component; @Component diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java index 962fb80179b..44a1f5418d4 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java @@ -61,19 +61,19 @@ public class SubscriptionChannelRegistry { return; } String channelName = theActiveSubscription.getChannelName(); - ourLog.info("Removing subscription {} from channel {}: {}", theActiveSubscription.getId() ,channelName, myActiveSubscriptionByChannelName); + ourLog.info("Removing subscription {} from channel {}", theActiveSubscription.getId() ,channelName); boolean removed = myActiveSubscriptionByChannelName.remove(channelName, theActiveSubscription.getId()); if (!removed) { ourLog.warn("Failed to remove subscription {} from channel {}", theActiveSubscription.getId() ,channelName); } - // This was the last one. Shut down the channel + // This was the last one. Close and remove the channel if (!myActiveSubscriptionByChannelName.containsKey(channelName)) { SubscriptionChannelWithHandlers channel = mySubscriptionChannelCache.get(channelName); if (channel != null) { channel.close(); } - mySubscriptionChannelCache.remove(channelName); + mySubscriptionChannelCache.closeAndRemove(channelName); } } diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelWithHandlers.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelWithHandlers.java index c155388dd26..d7681f89adc 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelWithHandlers.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelWithHandlers.java @@ -63,8 +63,4 @@ public class SubscriptionChannelWithHandlers implements Closeable { public MessageChannel getChannel() { return mySubscribableChannel; } - - public String getChannelName() { - return myChannelName; - } } diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionDeliveryHandlerFactory.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionDeliveryHandlerFactory.java index 7a70c1e74bc..d646786501b 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionDeliveryHandlerFactory.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionDeliveryHandlerFactory.java @@ -20,16 +20,13 @@ package ca.uhn.fhir.jpa.subscription.module.channel; * #L% */ -import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscriptionChannelType; import ca.uhn.fhir.jpa.subscription.module.subscriber.SubscriptionDeliveringRestHookSubscriber; import ca.uhn.fhir.jpa.subscription.module.subscriber.email.IEmailSender; import ca.uhn.fhir.jpa.subscription.module.subscriber.email.SubscriptionDeliveringEmailSubscriber; -import org.hl7.fhir.r4.model.Subscription; import org.springframework.beans.factory.annotation.Lookup; import org.springframework.messaging.MessageHandler; import org.springframework.stereotype.Component; -import org.thymeleaf.util.Validate; import java.util.Optional; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/config/BaseSubscriptionConfig.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/config/BaseSubscriptionConfig.java index cb9375bbd03..b22a7e7267d 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/config/BaseSubscriptionConfig.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/config/BaseSubscriptionConfig.java @@ -21,8 +21,8 @@ package ca.uhn.fhir.jpa.subscription.module.config; */ import ca.uhn.fhir.interceptor.executor.InterceptorService; -import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; import ca.uhn.fhir.jpa.subscription.module.cache.LinkedBlockingQueueSubscribableChannelFactory; +import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/SubscriptionWebsocketHandler.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/SubscriptionWebsocketHandler.java index 00084112138..d10cacfecea 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/SubscriptionWebsocketHandler.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/SubscriptionWebsocketHandler.java @@ -159,7 +159,6 @@ public class SubscriptionWebsocketHandler extends TextWebSocketHandler implement handleFailure(e); } } - } private class InitialState implements IState { @@ -212,94 +211,3 @@ public class SubscriptionWebsocketHandler extends TextWebSocketHandler implement } } - - -// private IIdType bingSearch(WebSocketSession theSession, String theRemaining) { -// Subscription subscription = new Subscription(); -// subscription.getChannel().setType(SubscriptionChannelType.WEBSOCKET); -// subscription.setStatus(SubscriptionStatus.ACTIVE); -// subscription.setCriteria(theRemaining); -// -// try { -// String params = theRemaining.substring(theRemaining.indexOf('?')+1); -// List paramValues = URLEncodedUtils.parse(params, Constants.CHARSET_UTF8, '&'); -// EncodingEnum encoding = EncodingEnum.JSON; -// for (NameValuePair nameValuePair : paramValues) { -// if (Constants.PARAM_FORMAT.equals(nameValuePair.getName())) { -// EncodingEnum nextEncoding = EncodingEnum.forContentType(nameValuePair.getValue()); -// if (nextEncoding != null) { -// encoding = nextEncoding; -// } -// } -// } -// -// IIdType id = ourSubscriptionDao.create(subscription).getId(); -// -// mySubscriptionPid = ourSubscriptionDao.getSubscriptionTablePidForSubscriptionResource(id); -// mySubscriptionId = subscription.getIdElement(); -// myState = new BoundDynamicSubscriptionState(theSession, encoding); -// -// return id; -// } catch (UnprocessableEntityException e) { -// ourLog.warn("Failed to bind subscription: " + e.getMessage()); -// try { -// theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), "Invalid bind request - " + e.getMessage())); -// } catch (IOException e2) { -// handleFailure(e2); -// } -// } catch (Exception e) { -// handleFailure(e); -// try { -// theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), "Invalid bind request - No ID included")); -// } catch (IOException e2) { -// handleFailure(e2); -// } -// } -// return null; -// } - - -//private class BoundDynamicSubscriptionState implements SubscriptionWebsocketHandler.IState { -// -// private EncodingEnum myEncoding; -// private WebSocketSession mySession; -// -// public BoundDynamicSubscriptionState(WebSocketSession theSession, EncodingEnum theEncoding) { -// mySession = theSession; -// myEncoding = theEncoding; -// } -// -// @Override -// public void closing() { -// ourLog.info("Deleting subscription {}", mySubscriptionId); -// try { -// ourSubscriptionDao.delete(mySubscriptionId, null); -// } catch (Exception e) { -// handleFailure(e); -// } -// } -// -// @Override -// public void deliver(List theResults) { -// try { -// for (IBaseResource nextResource : theResults) { -// ourLog.info("Sending WebSocket message for resource: {}", nextResource.getIdElement()); -// String encoded = myEncoding.newParser(ourCtx).encodeResourceToString(nextResource); -// String payload = "add " + mySubscriptionId.getIdPart() + '\n' + encoded; -// mySession.sendMessage(new TextMessage(payload)); -// } -// } catch (IOException e) { -// handleFailure(e); -// } -// } -// -// @Override -// public void handleTextMessage(WebSocketSession theSession, TextMessage theMessage) { -// try { -// theSession.sendMessage(new TextMessage("Unexpected client message: " + theMessage.getPayload())); -// } catch (IOException e) { -// handleFailure(e); -// } -// } -// -//} diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/BaseSubscriptionRegistryTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/BaseSubscriptionRegistryTest.java index a833ea2c9c7..7931f0864dd 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/BaseSubscriptionRegistryTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/BaseSubscriptionRegistryTest.java @@ -1,13 +1,8 @@ package ca.uhn.fhir.jpa.subscription.module.cache; import ca.uhn.fhir.jpa.subscription.module.BaseSubscriptionDstu3Test; -import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelRegistry; import org.hl7.fhir.dstu3.model.Subscription; import org.junit.After; -import org.springframework.beans.factory.annotation.Autowired; - -import static org.awaitility.Awaitility.await; -import static org.junit.Assert.assertEquals; public abstract class BaseSubscriptionRegistryTest extends BaseSubscriptionDstu3Test { public static final String SUBSCRIPTION_ID = "1"; diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistrySharedTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistrySharedTest.java index dbdfe3f7ee8..0c5924b0651 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistrySharedTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistrySharedTest.java @@ -2,17 +2,13 @@ package ca.uhn.fhir.jpa.subscription.module.cache; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.module.channel.ISubscriptionDeliveryChannelNamer; -import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionDeliveryChannelNamer; import org.hl7.fhir.dstu3.model.Subscription; -import org.junit.After; import org.junit.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.test.annotation.DirtiesContext; -import static org.junit.Assert.*; - @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) public class SubscriptionRegistrySharedTest extends BaseSubscriptionRegistryTest { diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistryTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistryTest.java index e7c67ae57de..12c37ff025e 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistryTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/cache/SubscriptionRegistryTest.java @@ -1,7 +1,6 @@ package ca.uhn.fhir.jpa.subscription.module.cache; import org.hl7.fhir.dstu3.model.Subscription; -import org.junit.After; import org.junit.Test; import static org.junit.Assert.*; diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/BaseBlockingQueueSubscribableChannelDstu3Test.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/BaseBlockingQueueSubscribableChannelDstu3Test.java index 9bc0953db1a..814fc3f05cd 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/BaseBlockingQueueSubscribableChannelDstu3Test.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/BaseBlockingQueueSubscribableChannelDstu3Test.java @@ -10,10 +10,10 @@ import ca.uhn.fhir.jpa.subscription.module.BaseSubscriptionDstu3Test; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscriptionChannelType; import ca.uhn.fhir.jpa.subscription.module.ResourceModifiedMessage; -import ca.uhn.fhir.jpa.subscription.module.channel.ISubscriptionDeliveryChannelNamer; -import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelFactory; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionLoader; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionRegistry; +import ca.uhn.fhir.jpa.subscription.module.channel.ISubscriptionDeliveryChannelNamer; +import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelFactory; import ca.uhn.fhir.jpa.subscription.module.config.MockFhirClientSubscriptionProvider; import ca.uhn.fhir.jpa.subscription.module.subscriber.ResourceModifiedJsonMessage; import ca.uhn.fhir.jpa.subscription.module.subscriber.SubscriptionMatchingSubscriberTest; @@ -210,8 +210,6 @@ public abstract class BaseBlockingQueueSubscribableChannelDstu3Test extends Base } @Override - public void clear() { - updateLatch.clear(); - } + public void clear() { updateLatch.clear();} } } diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/SubscriptionLoaderTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/SubscriptionLoaderTest.java index 4e036bd401e..543f62ac0df 100755 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/SubscriptionLoaderTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/standalone/SubscriptionLoaderTest.java @@ -1,9 +1,6 @@ package ca.uhn.fhir.jpa.subscription.module.standalone; -import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionLoader; import ca.uhn.fhir.jpa.subscription.module.config.MockFhirClientSubscriptionProvider; -import ca.uhn.fhir.rest.api.server.IBundleProvider; -import ca.uhn.fhir.rest.server.SimpleBundleProvider; import org.hl7.fhir.dstu3.model.Subscription; import org.junit.After; import org.junit.Before; diff --git a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/WebsocketConnectionValidatorTest.java b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/WebsocketConnectionValidatorTest.java index d679a5b6522..236fd5f8448 100644 --- a/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/WebsocketConnectionValidatorTest.java +++ b/hapi-fhir-jpaserver-subscription/src/test/java/ca/uhn/fhir/jpa/subscription/module/subscriber/websocket/WebsocketConnectionValidatorTest.java @@ -4,7 +4,6 @@ import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscription; import ca.uhn.fhir.jpa.subscription.module.CanonicalSubscriptionChannelType; import ca.uhn.fhir.jpa.subscription.module.cache.ActiveSubscription; import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionRegistry; -import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionChannelRegistry; import org.hl7.fhir.r4.model.IdType; import org.junit.Before; import org.junit.Test; @@ -13,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import static org.junit.Assert.*;