From 429550efb880a1eb473350a80451c71e5a870e5e Mon Sep 17 00:00:00 2001 From: allanmckenzie Date: Wed, 6 Oct 2021 16:24:14 +0100 Subject: [PATCH] Remove trigger from event_log table --- CHANGELOG.md | 2 ++ example-context/example-domain/pom.xml | 2 +- example-context/example-persistence/pom.xml | 2 +- .../persistence/CakeRepositoryIT.java | 2 +- .../example-command-api/pom.xml | 2 +- .../command/api/MakeCakeCommandApiTest.java | 2 +- .../command/api/OrderCakeCommandApiTest.java | 2 +- .../command/api/RecipeCommandApiTest.java | 2 +- .../example-command-handler/pom.xml | 2 +- .../command/handler/EventFactoryTest.java | 2 +- .../example-service/example-command/pom.xml | 2 +- .../example-custom/example-custom-api/pom.xml | 2 +- .../custom/api/OvenCustomApiTest.java | 2 +- .../custom/api/response/OvenStatusTest.java | 2 +- .../custom/api/response/OvensStatusTest.java | 2 +- .../example-service/example-custom/pom.xml | 2 +- .../example-event-source/pom.xml | 2 +- .../example-event-indexer/pom.xml | 2 +- .../example-event-listener/pom.xml | 2 +- ...RecipeAddedToIngredientsConverterTest.java | 2 +- .../RecipeAddedToRecipeConverterTest.java | 2 +- ...tListenerInterceptorChainProviderTest.java | 2 +- .../example-event-processor/pom.xml | 2 +- .../other-event-listener/pom.xml | 2 +- .../example-service/example-event/pom.xml | 2 +- .../example-feature-control/pom.xml | 2 +- .../example-service/example-it/pom.xml | 2 +- .../cakeshop/it/CakeShopEventBufferingIT.java | 2 +- .../cakeshop/it/CatchupPerformanceIT.java | 3 ++- .../example/cakeshop/it/EventHealingIT.java | 2 +- .../cakeshop/it/EventValidationIT.java | 3 ++- .../cakeshop/it/ListSystemCommandsIT.java | 9 ++------ .../example/cakeshop/it/RebuildIT.java | 2 +- .../it/helpers/BatchEventInserter.java | 23 +++++++++++++++++++ .../example-service/example-liquibase/pom.xml | 2 +- .../example-query/example-query-api/pom.xml | 2 +- .../query/api/CakeOrdersQueryApiTest.java | 2 +- .../cakeshop/query/api/CakesQueryApiTest.java | 2 +- .../cakeshop/query/api/IndexQueryApiTest.java | 2 +- .../query/api/RecipesQueryApiTest.java | 2 +- .../example-query/example-query-view/pom.xml | 2 +- .../query/api/request/CakesQueryViewTest.java | 2 +- .../query/view/CakeOrdersQueryViewTest.java | 2 +- .../query/view/IndexQueryViewTest.java | 2 +- .../query/view/RecipesQueryViewTest.java | 2 +- .../view/service/CakeOrderServiceTest.java | 2 +- .../query/view/service/CakeServiceTest.java | 2 +- .../query/view/service/IndexServiceTest.java | 2 +- .../example-service/example-query/pom.xml | 2 +- .../example-service/example-single/pom.xml | 2 +- example-context/example-service/pom.xml | 2 +- example-context/pom.xml | 2 +- pom.xml | 4 ++-- 53 files changed, 80 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3ff33c..2b1eccdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to ## [Unreleased] ### Changed - Created branch for version 8.x.x of the framework +- Included fix for out of memory error in catchup for large datasets +- Publishing of events no longer use a trigger on the event_log table ## [7.0.0] - 2021-09-27 ### Changed diff --git a/example-context/example-domain/pom.xml b/example-context/example-domain/pom.xml index 699c9ac4..109d8052 100644 --- a/example-context/example-domain/pom.xml +++ b/example-context/example-domain/pom.xml @@ -5,7 +5,7 @@ example-context uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-persistence/pom.xml b/example-context/example-persistence/pom.xml index b74c2234..24f706dc 100644 --- a/example-context/example-persistence/pom.xml +++ b/example-context/example-persistence/pom.xml @@ -5,7 +5,7 @@ example-context uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-persistence/src/test/java/uk/gov/justice/services/example/cakeshop/persistence/CakeRepositoryIT.java b/example-context/example-persistence/src/test/java/uk/gov/justice/services/example/cakeshop/persistence/CakeRepositoryIT.java index eb824198..d22e78c6 100644 --- a/example-context/example-persistence/src/test/java/uk/gov/justice/services/example/cakeshop/persistence/CakeRepositoryIT.java +++ b/example-context/example-persistence/src/test/java/uk/gov/justice/services/example/cakeshop/persistence/CakeRepositoryIT.java @@ -3,7 +3,7 @@ import static java.util.UUID.randomUUID; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import uk.gov.justice.services.example.cakeshop.persistence.entity.Cake; import uk.gov.justice.services.test.utils.persistence.BaseTransactionalTest; diff --git a/example-context/example-service/example-command/example-command-api/pom.xml b/example-context/example-service/example-command/example-command-api/pom.xml index 9fef929b..4e51f214 100644 --- a/example-context/example-service/example-command/example-command-api/pom.xml +++ b/example-context/example-service/example-command/example-command-api/pom.xml @@ -5,7 +5,7 @@ example-command uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/MakeCakeCommandApiTest.java b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/MakeCakeCommandApiTest.java index 3ad791d3..35ad4c9b 100644 --- a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/MakeCakeCommandApiTest.java +++ b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/MakeCakeCommandApiTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; import static uk.gov.justice.services.core.annotation.Component.COMMAND_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; diff --git a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/OrderCakeCommandApiTest.java b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/OrderCakeCommandApiTest.java index 0abf948e..598ecec6 100644 --- a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/OrderCakeCommandApiTest.java +++ b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/OrderCakeCommandApiTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; import static uk.gov.justice.services.core.annotation.Component.COMMAND_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; diff --git a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/RecipeCommandApiTest.java b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/RecipeCommandApiTest.java index 221dd41a..14678500 100644 --- a/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/RecipeCommandApiTest.java +++ b/example-context/example-service/example-command/example-command-api/src/test/java/uk/gov/justice/services/example/cakeshop/command/api/RecipeCommandApiTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static uk.gov.justice.services.core.annotation.Component.COMMAND_API; diff --git a/example-context/example-service/example-command/example-command-handler/pom.xml b/example-context/example-service/example-command/example-command-handler/pom.xml index 046545c3..37d4ec82 100644 --- a/example-context/example-service/example-command/example-command-handler/pom.xml +++ b/example-context/example-service/example-command/example-command-handler/pom.xml @@ -5,7 +5,7 @@ example-command uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-command/example-command-handler/src/test/java/uk/gov/justice/services/example/cakeshop/command/handler/EventFactoryTest.java b/example-context/example-service/example-command/example-command-handler/src/test/java/uk/gov/justice/services/example/cakeshop/command/handler/EventFactoryTest.java index fbbdfddc..ea3ff4e4 100644 --- a/example-context/example-service/example-command/example-command-handler/src/test/java/uk/gov/justice/services/example/cakeshop/command/handler/EventFactoryTest.java +++ b/example-context/example-service/example-command/example-command-handler/src/test/java/uk/gov/justice/services/example/cakeshop/command/handler/EventFactoryTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.command.handler; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import static uk.gov.justice.services.test.utils.core.messaging.JsonEnvelopeBuilder.envelope; import static uk.gov.justice.services.test.utils.core.messaging.MetadataBuilderFactory.metadataWithDefaults; diff --git a/example-context/example-service/example-command/pom.xml b/example-context/example-service/example-command/pom.xml index 9f43093b..a8fc8b0b 100644 --- a/example-context/example-service/example-command/pom.xml +++ b/example-context/example-service/example-command/pom.xml @@ -5,7 +5,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-custom/example-custom-api/pom.xml b/example-context/example-service/example-custom/example-custom-api/pom.xml index a9fd9b72..4394eef6 100644 --- a/example-context/example-service/example-custom/example-custom-api/pom.xml +++ b/example-context/example-service/example-custom/example-custom-api/pom.xml @@ -5,7 +5,7 @@ example-custom uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/OvenCustomApiTest.java b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/OvenCustomApiTest.java index 6cca7065..81ba898a 100644 --- a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/OvenCustomApiTest.java +++ b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/OvenCustomApiTest.java @@ -3,7 +3,7 @@ import static java.util.UUID.randomUUID; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isCustomHandlerClass; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMethodMatcher.method; import static uk.gov.justice.services.test.utils.core.messaging.JsonEnvelopeBuilder.envelope; diff --git a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvenStatusTest.java b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvenStatusTest.java index b3c905c3..e47aafff 100644 --- a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvenStatusTest.java +++ b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvenStatusTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.custom.api.response; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.UUID; diff --git a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvensStatusTest.java b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvensStatusTest.java index 3d520945..12e49bb2 100644 --- a/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvensStatusTest.java +++ b/example-context/example-service/example-custom/example-custom-api/src/test/java/uk/gov/justice/services/example/cakeshop/custom/api/response/OvensStatusTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.custom.api.response; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import java.util.List; diff --git a/example-context/example-service/example-custom/pom.xml b/example-context/example-service/example-custom/pom.xml index 4922d39a..0ec6700d 100644 --- a/example-context/example-service/example-custom/pom.xml +++ b/example-context/example-service/example-custom/pom.xml @@ -5,7 +5,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-event-source/pom.xml b/example-context/example-service/example-event-source/pom.xml index 90fa2c27..f91a69a4 100644 --- a/example-context/example-service/example-event-source/pom.xml +++ b/example-context/example-service/example-event-source/pom.xml @@ -5,7 +5,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-event/example-event-indexer/pom.xml b/example-context/example-service/example-event/example-event-indexer/pom.xml index 140ca602..af4d50fb 100644 --- a/example-context/example-service/example-event/example-event-indexer/pom.xml +++ b/example-context/example-service/example-event/example-event-indexer/pom.xml @@ -5,7 +5,7 @@ example-event uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-event/example-event-listener/pom.xml b/example-context/example-service/example-event/example-event-listener/pom.xml index f5cdbadd..83e178aa 100644 --- a/example-context/example-service/example-event/example-event-listener/pom.xml +++ b/example-context/example-service/example-event/example-event-listener/pom.xml @@ -5,7 +5,7 @@ example-event uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToIngredientsConverterTest.java b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToIngredientsConverterTest.java index 370aa5b7..2da9c11d 100644 --- a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToIngredientsConverterTest.java +++ b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToIngredientsConverterTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.event.listener.converter; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import uk.gov.justice.services.example.cakeshop.domain.event.RecipeAdded; diff --git a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToRecipeConverterTest.java b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToRecipeConverterTest.java index 54973ab3..88951f06 100644 --- a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToRecipeConverterTest.java +++ b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/converter/RecipeAddedToRecipeConverterTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.event.listener.converter; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import uk.gov.justice.services.example.cakeshop.domain.Ingredient; import uk.gov.justice.services.example.cakeshop.domain.event.RecipeAdded; diff --git a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/provider/ExampleEventListenerInterceptorChainProviderTest.java b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/provider/ExampleEventListenerInterceptorChainProviderTest.java index d5b554ca..a8722209 100644 --- a/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/provider/ExampleEventListenerInterceptorChainProviderTest.java +++ b/example-context/example-service/example-event/example-event-listener/src/test/java/uk/gov/justice/services/example/cakeshop/event/listener/provider/ExampleEventListenerInterceptorChainProviderTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.event.listener.provider; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import uk.gov.justice.services.core.interceptor.InterceptorChainEntry; diff --git a/example-context/example-service/example-event/example-event-processor/pom.xml b/example-context/example-service/example-event/example-event-processor/pom.xml index 0e4c4983..1c9e5d80 100644 --- a/example-context/example-service/example-event/example-event-processor/pom.xml +++ b/example-context/example-service/example-event/example-event-processor/pom.xml @@ -5,7 +5,7 @@ example-event uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 example-event-processor diff --git a/example-context/example-service/example-event/other-event-listener/pom.xml b/example-context/example-service/example-event/other-event-listener/pom.xml index 2eb5fc00..c1dba8e8 100644 --- a/example-context/example-service/example-event/other-event-listener/pom.xml +++ b/example-context/example-service/example-event/other-event-listener/pom.xml @@ -5,7 +5,7 @@ example-event uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-event/pom.xml b/example-context/example-service/example-event/pom.xml index 973ac92b..f7ff69a8 100644 --- a/example-context/example-service/example-event/pom.xml +++ b/example-context/example-service/example-event/pom.xml @@ -5,7 +5,7 @@ uk.gov.justice.services.example example-service - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-feature-control/pom.xml b/example-context/example-service/example-feature-control/pom.xml index 76b640a0..a6e0a5da 100644 --- a/example-context/example-service/example-feature-control/pom.xml +++ b/example-context/example-service/example-feature-control/pom.xml @@ -5,7 +5,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-it/pom.xml b/example-context/example-service/example-it/pom.xml index 4b554ef6..7e670360 100644 --- a/example-context/example-service/example-it/pom.xml +++ b/example-context/example-service/example-it/pom.xml @@ -5,7 +5,7 @@ uk.gov.justice.services.example example-service - 8.0.0 + 8.0.0-SNAPSHOT example-it diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CakeShopEventBufferingIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CakeShopEventBufferingIT.java index 9aa524a4..77c217af 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CakeShopEventBufferingIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CakeShopEventBufferingIT.java @@ -5,7 +5,7 @@ import static java.util.UUID.randomUUID; import static javax.ws.rs.client.Entity.entity; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.example.cakeshop.it.params.CakeShopMediaTypes.ADD_RECIPE_MEDIA_TYPE; import static uk.gov.justice.services.example.cakeshop.it.params.CakeShopMediaTypes.CONTEXT_NAME; import static uk.gov.justice.services.example.cakeshop.it.params.CakeShopUris.RECIPES_RESOURCE_URI; diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CatchupPerformanceIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CatchupPerformanceIT.java index 1eda242d..6538183a 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CatchupPerformanceIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/CatchupPerformanceIT.java @@ -6,7 +6,7 @@ import static java.util.Optional.empty; import static java.util.Optional.of; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; import static uk.gov.justice.services.eventstore.management.commands.EventCatchupCommand.CATCHUP; import static uk.gov.justice.services.jmx.system.command.client.connection.JmxParametersBuilder.jmxParameters; @@ -157,6 +157,7 @@ private void addEventsToEventLog(final int numberOfStreams, final int numberOfEv batchEventInserter.updateEventStreamTable(streamIds); batchEventInserter.updateEventLogTable(events); + batchEventInserter.updatePublishQueueTableWithEvents(events); } diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventHealingIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventHealingIT.java index bdd99834..d0662907 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventHealingIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventHealingIT.java @@ -8,7 +8,7 @@ import static javax.ws.rs.client.Entity.entity; import static javax.ws.rs.core.Response.Status.ACCEPTED; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; import static uk.gov.justice.services.eventstore.management.commands.EventCatchupCommand.CATCHUP; import static uk.gov.justice.services.example.cakeshop.it.params.CakeShopMediaTypes.ADD_RECIPE_MEDIA_TYPE; diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventValidationIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventValidationIT.java index 0360882c..88b9f64c 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventValidationIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/EventValidationIT.java @@ -6,7 +6,7 @@ import static java.util.Optional.of; import static javax.json.Json.createObjectBuilder; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; import static uk.gov.justice.services.jmx.api.domain.CommandState.COMMAND_COMPLETE; import static uk.gov.justice.services.jmx.api.domain.CommandState.COMMAND_FAILED; @@ -186,6 +186,7 @@ private void addEventsToEventLog(final int numberOfStreams, final int numberOfEv batchEventInserter.updateEventStreamTable(streamIds); batchEventInserter.updateEventLogTable(events); + batchEventInserter.updatePublishQueueTableWithEvents(events); } private void setPayloadsOfEventsInvalid() throws Exception { diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/ListSystemCommandsIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/ListSystemCommandsIT.java index 27f5fe27..643d99fd 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/ListSystemCommandsIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/ListSystemCommandsIT.java @@ -5,14 +5,12 @@ import static java.util.stream.Collectors.toMap; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; -import static uk.gov.justice.services.eventstore.management.commands.AddTriggerCommand.ADD_TRIGGER; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.eventstore.management.commands.DisablePublishingCommand.DISABLE_PUBLISHING; import static uk.gov.justice.services.eventstore.management.commands.EnablePublishingCommand.ENABLE_PUBLISHING; import static uk.gov.justice.services.eventstore.management.commands.EventCatchupCommand.CATCHUP; import static uk.gov.justice.services.eventstore.management.commands.IndexerCatchupCommand.INDEXER_CATCHUP; import static uk.gov.justice.services.eventstore.management.commands.RebuildCommand.REBUILD; -import static uk.gov.justice.services.eventstore.management.commands.RemoveTriggerCommand.REMOVE_TRIGGER; import static uk.gov.justice.services.eventstore.management.commands.ValidatePublishedEventsCommand.VALIDATE_EVENTS; import static uk.gov.justice.services.eventstore.management.commands.VerifyCatchupCommand.VERIFY_CATCHUP; import static uk.gov.justice.services.eventstore.management.commands.VerifyRebuildCommand.VERIFY_REBUILD; @@ -27,7 +25,6 @@ import uk.gov.justice.services.jmx.system.command.client.SystemCommanderClient; import uk.gov.justice.services.jmx.system.command.client.TestSystemCommanderClientFactory; import uk.gov.justice.services.jmx.system.command.client.connection.JmxParameters; -import uk.gov.justice.services.management.suspension.commands.RefreshFeatureControlCacheCommand; import java.util.List; import java.util.Map; @@ -56,13 +53,12 @@ public void shouldListAllSystemCommands() throws Exception { .getRemote(CONTEXT_NAME) .listCommands(); - assertThat(systemCommandDetailsList.size(), is(14)); + assertThat(systemCommandDetailsList.size(), is(12)); final Map systemCommandDetailsMap = systemCommandDetailsList .stream() .collect(toMap(SystemCommandDetails::getName, systemCommandDetails -> systemCommandDetails)); - assertThat(systemCommandDetailsMap.get(ADD_TRIGGER), is(notNullValue())); assertThat(systemCommandDetailsMap.get(DISABLE_PUBLISHING), is(notNullValue())); assertThat(systemCommandDetailsMap.get(ENABLE_PUBLISHING), is(notNullValue())); assertThat(systemCommandDetailsMap.get(CATCHUP), is(notNullValue())); @@ -70,7 +66,6 @@ public void shouldListAllSystemCommands() throws Exception { assertThat(systemCommandDetailsMap.get(PING), is(notNullValue())); assertThat(systemCommandDetailsMap.get(REBUILD), is(notNullValue())); assertThat(systemCommandDetailsMap.get(REFRESH_FEATURE_CACHE), is(notNullValue())); - assertThat(systemCommandDetailsMap.get(REMOVE_TRIGGER), is(notNullValue())); assertThat(systemCommandDetailsMap.get(SUSPEND), is(notNullValue())); assertThat(systemCommandDetailsMap.get(UNSUSPEND), is(notNullValue())); assertThat(systemCommandDetailsMap.get(VALIDATE_EVENTS), is(notNullValue())); diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/RebuildIT.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/RebuildIT.java index 8cb11f31..d90a492f 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/RebuildIT.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/RebuildIT.java @@ -8,7 +8,7 @@ import static java.util.stream.Collectors.toList; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; import static uk.gov.justice.services.eventstore.management.commands.RebuildCommand.REBUILD; import static uk.gov.justice.services.jmx.system.command.client.connection.JmxParametersBuilder.jmxParameters; diff --git a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/helpers/BatchEventInserter.java b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/helpers/BatchEventInserter.java index 0a524300..daccfc7b 100644 --- a/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/helpers/BatchEventInserter.java +++ b/example-context/example-service/example-it/src/test/java/uk/gov/justice/services/example/cakeshop/it/helpers/BatchEventInserter.java @@ -23,6 +23,9 @@ public class BatchEventInserter { private static final String SQL_INSERT_STREAM = "INSERT INTO event_stream " + "(stream_id, date_created, active) values (?, ?, ?)"; + private static final String SQL_INSERT_EVENT_INTO_PUBLISH_QUEUE = "INSERT INTO pre_publish_queue " + + "(event_log_id, date_queued) values (?, ?)"; + private final DataSource eventStoreDataSource; private final int batchSize; @@ -80,4 +83,24 @@ public void updateEventStreamTable(final List streamIds) throws Exception preparedStatement.executeBatch(); } } + + public void updatePublishQueueTableWithEvents(final List events) throws Exception { + + try (final Connection connection = eventStoreDataSource.getConnection(); + final PreparedStatement preparedStatement = connection.prepareStatement(SQL_INSERT_EVENT_INTO_PUBLISH_QUEUE)) { + for (int i = 0; i < events.size(); i++) { + final UUID eventId = events.get(i).getId(); + preparedStatement.setObject(1, eventId); + preparedStatement.setTimestamp(2, toSqlTimestamp(clock.now())); + + preparedStatement.addBatch(); + + if (i % batchSize == 0) { + preparedStatement.executeBatch(); + } + } + + preparedStatement.executeBatch(); + } + } } diff --git a/example-context/example-service/example-liquibase/pom.xml b/example-context/example-service/example-liquibase/pom.xml index 674d44a4..f1bedcbe 100644 --- a/example-context/example-service/example-liquibase/pom.xml +++ b/example-context/example-service/example-liquibase/pom.xml @@ -5,7 +5,7 @@ uk.gov.justice.services.example example-service - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-query/example-query-api/pom.xml b/example-context/example-service/example-query/example-query-api/pom.xml index 76556b43..3b92b1de 100644 --- a/example-context/example-service/example-query/example-query-api/pom.xml +++ b/example-context/example-service/example-query/example-query-api/pom.xml @@ -5,7 +5,7 @@ example-query uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakeOrdersQueryApiTest.java b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakeOrdersQueryApiTest.java index 99ae5e71..76369f11 100644 --- a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakeOrdersQueryApiTest.java +++ b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakeOrdersQueryApiTest.java @@ -1,7 +1,7 @@ package uk.gov.justice.services.example.cakeshop.query.api; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.core.annotation.Component.QUERY_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMethodMatcher.method; diff --git a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakesQueryApiTest.java b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakesQueryApiTest.java index 28448a40..ce4392aa 100644 --- a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakesQueryApiTest.java +++ b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/CakesQueryApiTest.java @@ -1,6 +1,6 @@ package uk.gov.justice.services.example.cakeshop.query.api; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.core.annotation.Component.QUERY_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMethodMatcher.method; diff --git a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/IndexQueryApiTest.java b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/IndexQueryApiTest.java index fb58f29c..a743e662 100644 --- a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/IndexQueryApiTest.java +++ b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/IndexQueryApiTest.java @@ -1,6 +1,6 @@ package uk.gov.justice.services.example.cakeshop.query.api; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.core.annotation.Component.QUERY_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMethodMatcher.method; diff --git a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/RecipesQueryApiTest.java b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/RecipesQueryApiTest.java index 7e28df35..22ea5482 100644 --- a/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/RecipesQueryApiTest.java +++ b/example-context/example-service/example-query/example-query-api/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/RecipesQueryApiTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.Matchers.allOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static uk.gov.justice.services.core.annotation.Component.QUERY_API; import static uk.gov.justice.services.test.utils.core.matchers.HandlerClassMatcher.isHandlerClass; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMethodMatcher.method; diff --git a/example-context/example-service/example-query/example-query-view/pom.xml b/example-context/example-service/example-query/example-query-view/pom.xml index 2e9e49ae..72524033 100644 --- a/example-context/example-service/example-query/example-query-view/pom.xml +++ b/example-context/example-service/example-query/example-query-view/pom.xml @@ -5,7 +5,7 @@ example-query uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/request/CakesQueryViewTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/request/CakesQueryViewTest.java index f101973b..aa86b2f2 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/request/CakesQueryViewTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/api/request/CakesQueryViewTest.java @@ -3,7 +3,7 @@ import static java.util.Arrays.asList; import static java.util.UUID.randomUUID; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import static uk.gov.justice.services.core.annotation.Component.QUERY_VIEW; import static uk.gov.justice.services.test.utils.core.matchers.HandlerMatcher.isHandler; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/CakeOrdersQueryViewTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/CakeOrdersQueryViewTest.java index e191c03a..0636b6a6 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/CakeOrdersQueryViewTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/CakeOrdersQueryViewTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import static uk.gov.justice.services.core.annotation.Component.QUERY_VIEW; import static uk.gov.justice.services.messaging.Envelope.envelopeFrom; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/IndexQueryViewTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/IndexQueryViewTest.java index 3006ce53..293660d2 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/IndexQueryViewTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/IndexQueryViewTest.java @@ -2,7 +2,7 @@ import static java.util.UUID.randomUUID; import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import static uk.gov.justice.services.core.annotation.Component.QUERY_VIEW; import static uk.gov.justice.services.messaging.Envelope.envelopeFrom; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/RecipesQueryViewTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/RecipesQueryViewTest.java index aa725953..df97da4b 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/RecipesQueryViewTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/RecipesQueryViewTest.java @@ -8,7 +8,7 @@ import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import static uk.gov.justice.services.core.annotation.Component.QUERY_VIEW; import static uk.gov.justice.services.messaging.Envelope.envelopeFrom; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeOrderServiceTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeOrderServiceTest.java index 2bcf51d0..343e9a94 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeOrderServiceTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeOrderServiceTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeServiceTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeServiceTest.java index ea6bb633..c33ad103 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeServiceTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/CakeServiceTest.java @@ -3,7 +3,7 @@ import static java.util.Arrays.asList; import static java.util.UUID.randomUUID; import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; import uk.gov.justice.services.example.cakeshop.persistence.CakeRepository; diff --git a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/IndexServiceTest.java b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/IndexServiceTest.java index d4aed067..cf46c44a 100644 --- a/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/IndexServiceTest.java +++ b/example-context/example-service/example-query/example-query-view/src/test/java/uk/gov/justice/services/example/cakeshop/query/view/service/IndexServiceTest.java @@ -4,7 +4,7 @@ import static java.util.UUID.randomUUID; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; diff --git a/example-context/example-service/example-query/pom.xml b/example-context/example-service/example-query/pom.xml index d5414717..f3bec93d 100644 --- a/example-context/example-service/example-query/pom.xml +++ b/example-context/example-service/example-query/pom.xml @@ -5,7 +5,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/example-single/pom.xml b/example-context/example-service/example-single/pom.xml index 5e5db303..a415fecd 100644 --- a/example-context/example-service/example-single/pom.xml +++ b/example-context/example-service/example-single/pom.xml @@ -3,7 +3,7 @@ example-service uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/example-service/pom.xml b/example-context/example-service/pom.xml index 9517d840..01cbd7c2 100644 --- a/example-context/example-service/pom.xml +++ b/example-context/example-service/pom.xml @@ -5,7 +5,7 @@ example-context uk.gov.justice.services.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/example-context/pom.xml b/example-context/pom.xml index 4df280a2..02788319 100644 --- a/example-context/pom.xml +++ b/example-context/pom.xml @@ -5,7 +5,7 @@ cake-shop uk.gov.justice.example - 8.0.0 + 8.0.0-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 41339f18..70f93eaa 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ uk.gov.justice.example cake-shop - 8.0.0 + 8.0.0-SNAPSHOT pom Cakeshop Application @@ -33,7 +33,7 @@ 8.0.1 8.0.1 - 8.0.1 + 8.1.0