You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/11/17 09:56:02 UTC

(causeway-app-simpleapp) branch jpa-SNAPSHOT updated: adds @DirtiesContext as a workaround for MetaModelContext being a singleton

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

danhaywood pushed a commit to branch jpa-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/causeway-app-simpleapp.git


The following commit(s) were added to refs/heads/jpa-SNAPSHOT by this push:
     new ed5e9a2  adds @DirtiesContext as a workaround for MetaModelContext being a singleton
ed5e9a2 is described below

commit ed5e9a293d325ef0c99d2a2415007af16812f382
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Nov 17 09:55:51 2023 +0000

    adds @DirtiesContext as a workaround for MetaModelContext being a singleton
    
    ... I think the issue is that different integ tests within the same mvn module cannot mix-n-match the set of modules that they are bootstrapping?
---
 .../webapp/integtests/metamodel/ValidateDomainModel_IntegTest.java     | 3 +++
 .../test/java/domainapp/webapp/integtests/smoke/Smoke_IntegTest.java   | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/ValidateDomainModel_IntegTest.java b/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/ValidateDomainModel_IntegTest.java
index 19f7049..32cd5e5 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/ValidateDomainModel_IntegTest.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/ValidateDomainModel_IntegTest.java
@@ -7,8 +7,11 @@ import org.junit.jupiter.api.Test;
 import org.apache.causeway.applib.services.registry.ServiceRegistry;
 import org.apache.causeway.testing.integtestsupport.applib.validate.DomainModelValidator;
 
+import org.springframework.test.annotation.DirtiesContext;
+
 import domainapp.webapp.integtests.WebAppIntegTestAbstract;
 
+@DirtiesContext
 class ValidateDomainModel_IntegTest extends WebAppIntegTestAbstract {
 
     @Inject ServiceRegistry serviceRegistry;
diff --git a/webapp-tests/src/test/java/domainapp/webapp/integtests/smoke/Smoke_IntegTest.java b/webapp-tests/src/test/java/domainapp/webapp/integtests/smoke/Smoke_IntegTest.java
index 78c6cf6..f7954f3 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/integtests/smoke/Smoke_IntegTest.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/integtests/smoke/Smoke_IntegTest.java
@@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.transaction.annotation.Transactional;
 
 import org.apache.causeway.applib.services.wrapper.InvalidException;
@@ -18,6 +19,7 @@ import domainapp.modules.simple.dom.so.SimpleObject;
 import domainapp.modules.simple.dom.so.SimpleObjects;
 import domainapp.webapp.integtests.WebAppIntegTestAbstract;
 
+@DirtiesContext
 @Transactional
 class Smoke_IntegTest extends WebAppIntegTestAbstract {