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


The following commit(s) were added to refs/heads/ISIS-3110 by this push:
     new 9fca7a37cb ISIS-3110: fixes integ test
9fca7a37cb is described below

commit 9fca7a37cb6808e41d9c0482fe90cc0c7a0b18cb
Author: Dan Haywood <[email protected]>
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")

Reply via email to