You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2022/08/04 09:31:06 UTC

[isis] 06/12: ISIS-3110: fixes integ test

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-3110
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 776c7465b12820b3943da7a2c10e09965349605f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Aug 4 06:45:59 2022 +0100

    ISIS-3110: fixes integ test
---
 .../IsisModuleExtExecutionOutboxPersistenceJpa.java  |  3 +++
 .../integtests/OutboxRestClient_IntegTest.java       | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/extensions/core/executionoutbox/persistence-jpa/src/main/java/org/apache/isis/extensions/executionoutbox/jpa/IsisModuleExtExecutionOutboxPersistenceJpa.java b/extensions/core/executionoutbox/persistence-jpa/src/main/java/org/apache/isis/extensions/executionoutbox/jpa/IsisModuleExtExecutionOutboxPersistenceJpa.java
index c7929ec451..76521823bf 100644
--- a/extensions/core/executionoutbox/persistence-jpa/src/main/java/org/apache/isis/extensions/executionoutbox/jpa/IsisModuleExtExecutionOutboxPersistenceJpa.java
+++ b/extensions/core/executionoutbox/persistence-jpa/src/main/java/org/apache/isis/extensions/executionoutbox/jpa/IsisModuleExtExecutionOutboxPersistenceJpa.java
@@ -18,10 +18,13 @@
  */
 package org.apache.isis.extensions.executionoutbox.jpa;
 
+import javax.inject.Inject;
+
 import org.springframework.boot.autoconfigure.domain.EntityScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 
+import org.apache.isis.applib.services.iactnlayer.InteractionService;
 import org.apache.isis.extensions.executionoutbox.applib.IsisModuleExtExecutionOutboxApplib;
 import org.apache.isis.extensions.executionoutbox.jpa.dom.ExecutionOutboxEntry;
 import org.apache.isis.extensions.executionoutbox.jpa.dom.ExecutionOutboxEntryPK;
diff --git a/extensions/core/executionoutbox/restclient/src/test/java/org/apache/isis/extensions/executionoutbox/restclient/integtests/OutboxRestClient_IntegTest.java b/extensions/core/executionoutbox/restclient/src/test/java/org/apache/isis/extensions/executionoutbox/restclient/integtests/OutboxRestClient_IntegTest.java
index 1c3db06c86..0ba779bfe4 100644
--- a/extensions/core/executionoutbox/restclient/src/test/java/org/apache/isis/extensions/executionoutbox/restclient/integtests/OutboxRestClient_IntegTest.java
+++ b/extensions/core/executionoutbox/restclient/src/test/java/org/apache/isis/extensions/executionoutbox/restclient/integtests/OutboxRestClient_IntegTest.java
@@ -106,19 +106,21 @@ public class OutboxRestClient_IntegTest  {
 
     @BeforeEach
     void beforeEach() {
-        transactionService.runTransactional(Propagation.REQUIRED, () -> {
-            counterRepository.removeAll();
-            executionOutboxEntryRepository.removeAll();
+        interactionService.runAnonymous(() -> {
+            transactionService.runTransactional(Propagation.REQUIRED, () -> {
+                counterRepository.removeAll();
+                executionOutboxEntryRepository.removeAll();
 
-            assertThat(counterRepository.find()).isEmpty();
+                assertThat(counterRepository.find()).isEmpty();
 
-            counter1 = counterRepository.persist(Counter.builder().name("counter-1").build());
-            counter2 = counterRepository.persist(Counter.builder().name("counter-2").build());
+                counter1 = counterRepository.persist(Counter.builder().name("counter-1").build());
+                counter2 = counterRepository.persist(Counter.builder().name("counter-2").build());
 
-            assertThat(counterRepository.find()).hasSize(2);
+                assertThat(counterRepository.find()).hasSize(2);
 
-            List<? extends ExecutionOutboxEntry> all = executionOutboxEntryRepository.findOldest();
-            assertThat(all).isEmpty();
+                List<? extends ExecutionOutboxEntry> all = executionOutboxEntryRepository.findOldest();
+                assertThat(all).isEmpty();
+            });
         });
 
         outboxClient = restEndpointService.newClient(port, "any", "any-password-because-security-bypass-module-is-configured")