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/30 21:53:43 UTC

[isis-app-simpleapp] branch attempting-to-bring-in-bdd-specs created (now 70d13bc)

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

danhaywood pushed a change to branch attempting-to-bring-in-bdd-specs
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git


      at 70d13bc  no joy yet

This branch includes the following new commits:

     new 4626255  reintroduces bdd tests, though not yet being found...
     new 796608c  still don't have bdd features being found...
     new 70d13bc  no joy yet

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[isis-app-simpleapp] 02/03: still don't have bdd features being found...

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch attempting-to-bring-in-bdd-specs
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git

commit 796608c05986ec71271bd3c31fa8eefda3b16a51
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Aug 30 22:30:12 2022 +0100

    still don't have bdd features being found...
---
 .../domainapp/webapp/bdd/{stepdefs => specs}/BddStepDefsModule.java   | 2 +-
 .../bdd/{stepdefs/infrastructure => specs}/BootstrapStepDef.java      | 4 +---
 .../src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java        | 1 -
 .../java/domainapp/webapp/bdd/{ => specs}/CucumberTestAbstract.java   | 2 +-
 .../webapp/bdd/{stepdefs/fixtures => specs}/DomainAppDemoStepDef.java | 2 +-
 .../webapp/bdd/{stepdefs/domain => specs}/SimpleObjectsContext.java   | 2 +-
 .../bdd/{stepdefs/domain => specs}/SimpleObjectsGivenThenStepDef.java | 3 +--
 .../bdd/{stepdefs/domain => specs}/SimpleObjectsWhenStepDef.java      | 3 +--
 .../bdd/{stepdefs/infrastructure => specs}/TransactionalStepDef.java  | 2 +-
 .../java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java     | 2 +-
 webapp-tests/src/test/resources/junit-platform.properties             | 2 +-
 11 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BddStepDefsModule.java
similarity index 88%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BddStepDefsModule.java
index ae49680..1925e7c 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BddStepDefsModule.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs;
+package domainapp.webapp.bdd.specs;
 
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BootstrapStepDef.java
similarity index 69%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BootstrapStepDef.java
index cb62838..d163021 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/BootstrapStepDef.java
@@ -1,9 +1,7 @@
-package domainapp.webapp.bdd.stepdefs.infrastructure;
+package domainapp.webapp.bdd.specs;
 
 import org.apache.isis.applib.annotation.PriorityPrecedence;
 
-import domainapp.webapp.bdd.CucumberTestAbstract;
-
 public class BootstrapStepDef extends CucumberTestAbstract {
 
     @io.cucumber.java.Before(order= PriorityPrecedence.FIRST)
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java
index 1198cb1..c315fef 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java
@@ -31,7 +31,6 @@ import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME;
 @Suite
 @IncludeEngines("cucumber")
 @SelectClasspathResource("domainapp/webapp/bdd/specs")
-//@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "domainapp.webapp.bdd.stepdefs")
 public class CucumberSpec {
 
 }
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
similarity index 97%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
index 43c9e50..d19ba11 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package domainapp.webapp.bdd;
+package domainapp.webapp.bdd.specs;
 
 import domainapp.webapp.integtests.WebAppIntegTestAbstract;
 import io.cucumber.spring.CucumberContextConfiguration;
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/DomainAppDemoStepDef.java
similarity index 91%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/DomainAppDemoStepDef.java
index 6f1953a..7c9dd0d 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/DomainAppDemoStepDef.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs.fixtures;
+package domainapp.webapp.bdd.specs;
 
 import javax.inject.Inject;
 
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsContext.java
similarity index 89%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsContext.java
index 707bc2d..b5cf9fa 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsContext.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs.domain;
+package domainapp.webapp.bdd.specs;
 
 import org.springframework.stereotype.Service;
 
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsGivenThenStepDef.java
similarity index 94%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsGivenThenStepDef.java
index 77f3b10..b174784 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsGivenThenStepDef.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs.domain;
+package domainapp.webapp.bdd.specs;
 
 import java.util.List;
 
@@ -13,7 +13,6 @@ import lombok.val;
 
 import domainapp.modules.simple.dom.so.SimpleObject;
 import domainapp.modules.simple.dom.so.SimpleObjects;
-import domainapp.webapp.bdd.CucumberTestAbstract;
 import io.cucumber.java.en.Given;
 import io.cucumber.java.en.Then;
 
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsWhenStepDef.java
similarity index 91%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsWhenStepDef.java
index ab7efb4..f9864cd 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/SimpleObjectsWhenStepDef.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs.domain;
+package domainapp.webapp.bdd.specs;
 
 import java.util.UUID;
 
@@ -9,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.fail;
 import org.apache.isis.applib.services.wrapper.InvalidException;
 
 import domainapp.modules.simple.dom.so.SimpleObjects;
-import domainapp.webapp.bdd.CucumberTestAbstract;
 import io.cucumber.java.en.When;
 
 public class SimpleObjectsWhenStepDef extends CucumberTestAbstract {
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/TransactionalStepDef.java
similarity index 96%
rename from webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java
rename to webapp-tests/src/test/java/domainapp/webapp/bdd/specs/TransactionalStepDef.java
index b14eae3..3626c47 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/TransactionalStepDef.java
@@ -1,4 +1,4 @@
-package domainapp.webapp.bdd.stepdefs.infrastructure;
+package domainapp.webapp.bdd.specs;
 
 import javax.inject.Inject;
 
diff --git a/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java b/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
index 5bd91c0..037ebab 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
@@ -18,7 +18,7 @@ import org.apache.isis.testing.integtestsupport.applib.IsisIntegrationTestAbstra
 
 import domainapp.modules.simple.SimpleModule;
 import domainapp.webapp.application.ApplicationModule;
-import domainapp.webapp.bdd.stepdefs.BddStepDefsModule;
+import domainapp.webapp.bdd.specs.BddStepDefsModule;
 
 @SpringBootTest(
     classes = {
diff --git a/webapp-tests/src/test/resources/junit-platform.properties b/webapp-tests/src/test/resources/junit-platform.properties
index 17785d9..d4347d9 100644
--- a/webapp-tests/src/test/resources/junit-platform.properties
+++ b/webapp-tests/src/test/resources/junit-platform.properties
@@ -2,7 +2,7 @@
 cucumber.publish.quiet=true
 cucumber.filter.tags=not @backlog and not @ignore
 
-#cucumber.glue=domainapp.webapp.bdd.stepdefs
+cucumber.glue=domainapp.webapp.bdd.specs
 #we are using built-in reporting plugins
 cucumber.plugin=pretty, html:target/cucumber-reports/cucumber-report.html
 


[isis-app-simpleapp] 01/03: reintroduces bdd tests, though not yet being found...

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch attempting-to-bring-in-bdd-specs
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git

commit 4626255afce6d5098c83f1b432473a71a9d21533
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Aug 30 22:22:18 2022 +0100

    reintroduces bdd tests, though not yet being found...
---
 pom.xml                                            |  2 +
 webapp-tests/pom.xml                               | 85 ++++++++++++++++++++++
 .../domainapp/webapp/bdd/CucumberTestAbstract.java | 34 +++++++++
 .../domainapp/webapp/bdd/specs/CucumberSpec.java   | 37 ++++++++++
 .../webapp/bdd/stepdefs/BddStepDefsModule.java     | 13 ++++
 .../bdd/stepdefs/domain/SimpleObjectsContext.java  | 21 ++++++
 .../domain/SimpleObjectsGivenThenStepDef.java      | 54 ++++++++++++++
 .../stepdefs/domain/SimpleObjectsWhenStepDef.java  | 41 +++++++++++
 .../stepdefs/fixtures/DomainAppDemoStepDef.java    | 21 ++++++
 .../stepdefs/infrastructure/BootstrapStepDef.java  | 14 ++++
 .../infrastructure/TransactionalStepDef.java       | 50 +++++++++++++
 .../webapp/integtests/WebAppIntegTestAbstract.java |  2 +
 .../metamodel/lockdown/current/.gitignore          |  1 +
 .../unittests/archunit/ArchitectureTests.java      | 64 ++++++++++++++++
 .../mavendeps/lockdown/current/.gitignore          |  1 +
 .../SimpleObjectSpec_listAllAndCreate.feature      | 14 ++++
 .../bdd/specs/SimpleObjectSpec_updateName.feature  | 16 ++++
 .../src/test/resources/junit-platform.properties   | 19 +++++
 18 files changed, 489 insertions(+)

diff --git a/pom.xml b/pom.xml
index 1e28a6f..4fce2f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,6 +20,8 @@
 
     <properties>
         <java.version>11</java.version>
+        <maven-cucumber-reporting.version>5.3.0</maven-cucumber-reporting.version>
+        <skipBDD>${skipTests}</skipBDD>
     </properties>
 
     <dependencyManagement>
diff --git a/webapp-tests/pom.xml b/webapp-tests/pom.xml
index f717f29..b29c5f7 100644
--- a/webapp-tests/pom.xml
+++ b/webapp-tests/pom.xml
@@ -30,6 +30,67 @@
                 </excludes>
             </testResource>
         </testResources>
+        <plugins>
+
+            <!-- generate cucumber json result -->
+<!--
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-antrun-plugin</artifactId>
+              <executions>
+                <execution>
+                  <id>cucumber-cli</id>
+                  <phase>integration-test</phase>
+                  <goals>
+                    <goal>run</goal>
+                  </goals>
+                  <configuration>
+                    <skip>${skipBDD}</skip>
+                    <target>
+                      <echo message="Running Cucumber CLI" />
+                      <java classname="io.cucumber.core.cli.Main"
+                            fork="true"
+                            failonerror="true"
+                            newenvironment="true"
+                            maxmemory="1024m"
+                            classpathref="maven.test.classpath">
+                        <arg value="&#45;&#45;plugin" />
+                        <arg value="json:${project.build.directory}/cucumber-no-clobber.json" />
+                      </java>
+                    </target>
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+-->
+
+            <!-- generate html report from cucumber json result -->
+<!--
+            <plugin>
+                <groupId>net.masterthought</groupId>
+                <artifactId>maven-cucumber-reporting</artifactId>
+                <version>${maven-cucumber-reporting.version}</version>
+                <executions>
+                    <execution>
+                        <id>default</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <projectName>SimpleApp</projectName>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <inputDirectory>${project.build.directory}</inputDirectory>
+                            <jsonFiles>
+                                <param>**/cucumber-no-clobber.json</param>
+                            </jsonFiles>
+                            <skip>${skipBDD}</skip>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+-->
+        </plugins>
     </build>
 
     <dependencies>
@@ -48,6 +109,12 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.isis.testing</groupId>
+            <artifactId>isis-testing-specsupport-applib</artifactId>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.isis.testing</groupId>
             <artifactId>isis-testing-fakedata-applib</artifactId>
@@ -60,6 +127,24 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-suite-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.tngtech.archunit</groupId>
+            <artifactId>archunit-junit5-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.tngtech.archunit</groupId>
+            <artifactId>archunit-junit5-engine</artifactId>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
 </project>
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java
new file mode 100644
index 0000000..43c9e50
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/CucumberTestAbstract.java
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package domainapp.webapp.bdd;
+
+import domainapp.webapp.integtests.WebAppIntegTestAbstract;
+import io.cucumber.spring.CucumberContextConfiguration;
+
+/**
+ *
+ * Provides the App's Spring Context for testing with Cucumber.
+ *
+ */
+@CucumberContextConfiguration
+public abstract class CucumberTestAbstract extends WebAppIntegTestAbstract {
+
+    // any cucumber specific stuff might go here
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java
new file mode 100644
index 0000000..1198cb1
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberSpec.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package domainapp.webapp.bdd.specs;
+
+import org.junit.platform.suite.api.ConfigurationParameter;
+import org.junit.platform.suite.api.IncludeEngines;
+import org.junit.platform.suite.api.SelectClasspathResource;
+import org.junit.platform.suite.api.Suite;
+
+import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME;
+
+/**
+ * Cucumber will scan under the specified {@link SelectClasspathResource classpath} for feature files.
+ */
+@Suite
+@IncludeEngines("cucumber")
+@SelectClasspathResource("domainapp/webapp/bdd/specs")
+//@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "domainapp.webapp.bdd.stepdefs")
+public class CucumberSpec {
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java
new file mode 100644
index 0000000..ae49680
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/BddStepDefsModule.java
@@ -0,0 +1,13 @@
+package domainapp.webapp.bdd.stepdefs;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+
+import domainapp.modules.simple.SimpleModule;
+
+@Configuration
+@ComponentScan
+public class BddStepDefsModule {
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java
new file mode 100644
index 0000000..707bc2d
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsContext.java
@@ -0,0 +1,21 @@
+package domainapp.webapp.bdd.stepdefs.domain;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.wrapper.InvalidException;
+
+import lombok.Data;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+import io.cucumber.spring.ScenarioScope;
+
+@Service
+@ScenarioScope
+@Data
+public class SimpleObjectsContext {
+
+    private SimpleObject simpleObject;
+    private String originalName;
+    private InvalidException ex;
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java
new file mode 100644
index 0000000..77f3b10
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsGivenThenStepDef.java
@@ -0,0 +1,54 @@
+package domainapp.webapp.bdd.stepdefs.domain;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.assertj.core.api.Assertions;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import lombok.val;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+import domainapp.modules.simple.dom.so.SimpleObjects;
+import domainapp.webapp.bdd.CucumberTestAbstract;
+import io.cucumber.java.en.Given;
+import io.cucumber.java.en.Then;
+
+public class SimpleObjectsGivenThenStepDef extends CucumberTestAbstract {
+
+    @Inject protected SimpleObjects simpleObjects;
+    @Inject protected SimpleObjectsContext context;
+
+    @Given("a simple object")
+    public void a_simple_object() {
+        val simpleObject = wrap(simpleObjects).listAll().get(0);
+        context.setSimpleObject(simpleObject);
+        context.setOriginalName(simpleObject.getName());
+    }
+
+    @Given("^there (?:is|are).* (\\d+) simple object[s]?$")
+    public void there_are_N_simple_objects(int n) {
+        final List<SimpleObject> list = wrap(simpleObjects).listAll();
+        assertThat(list.size(), is(n));
+    }
+
+    @Then("the name is now {string}")
+    public void the_name_is_now(String name) {
+        Assertions.assertThat(context.getSimpleObject().getName()).isEqualTo(name);
+    }
+
+    @Then("the name is unchanged")
+    public void the_name_is_unchanged() {
+        Assertions.assertThat(context.getSimpleObject().getName()).isEqualTo(context.getOriginalName());
+    }
+
+    @Then("a warning is raised")
+    public void a_warning_is_raised() {
+        Assertions.assertThat(context.getEx()).isNotNull();
+    }
+
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java
new file mode 100644
index 0000000..ab7efb4
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/domain/SimpleObjectsWhenStepDef.java
@@ -0,0 +1,41 @@
+package domainapp.webapp.bdd.stepdefs.domain;
+
+import java.util.UUID;
+
+import javax.inject.Inject;
+
+import static org.junit.jupiter.api.Assertions.fail;
+
+import org.apache.isis.applib.services.wrapper.InvalidException;
+
+import domainapp.modules.simple.dom.so.SimpleObjects;
+import domainapp.webapp.bdd.CucumberTestAbstract;
+import io.cucumber.java.en.When;
+
+public class SimpleObjectsWhenStepDef extends CucumberTestAbstract {
+
+    @Inject protected SimpleObjects simpleObjects;
+    @Inject protected SimpleObjectsContext context;
+
+    @When("^.*create (?:a|another) .*simple object$")
+    public void create_a_simple_object() {
+
+        wrap(simpleObjects).create(UUID.randomUUID().toString());
+    }
+
+    @When("^.*modify the name to '(.*)'")
+    public void modify_the_name_to(String newName) {
+        wrap(context.getSimpleObject()).updateName(newName);
+    }
+
+    @When("^.*attempt to change the name to '(.*)'")
+    public void attempt_to_change_the_name_to(String newName) {
+        try {
+            wrap(context.getSimpleObject()).updateName(newName);
+            fail();
+        } catch(InvalidException ex) {
+            this.context.setEx(ex);
+        }
+    }
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java
new file mode 100644
index 0000000..6f1953a
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/fixtures/DomainAppDemoStepDef.java
@@ -0,0 +1,21 @@
+package domainapp.webapp.bdd.stepdefs.fixtures;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.PriorityPrecedence;
+import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScripts;
+
+import domainapp.webapp.application.fixture.scenarios.DomainAppDemo;
+
+public class DomainAppDemoStepDef {
+
+    @Inject private FixtureScripts fixtureScripts;
+
+    @io.cucumber.java.Before(value="@DomainAppDemo", order= PriorityPrecedence.MIDPOINT)
+    public void runDomainAppDemo() {
+
+        fixtureScripts.runFixtureScript(new DomainAppDemo(), null); // <1>
+
+    }
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java
new file mode 100644
index 0000000..cb62838
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/BootstrapStepDef.java
@@ -0,0 +1,14 @@
+package domainapp.webapp.bdd.stepdefs.infrastructure;
+
+import org.apache.isis.applib.annotation.PriorityPrecedence;
+
+import domainapp.webapp.bdd.CucumberTestAbstract;
+
+public class BootstrapStepDef extends CucumberTestAbstract {
+
+    @io.cucumber.java.Before(order= PriorityPrecedence.FIRST)
+    public void bootstrap() {
+        // empty
+    }
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java
new file mode 100644
index 0000000..b14eae3
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/stepdefs/infrastructure/TransactionalStepDef.java
@@ -0,0 +1,50 @@
+package domainapp.webapp.bdd.stepdefs.infrastructure;
+
+import javax.inject.Inject;
+
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.support.TransactionTemplate;
+
+import org.apache.isis.applib.annotation.PriorityPrecedence;
+import org.apache.isis.applib.services.iactnlayer.InteractionContext;
+import org.apache.isis.applib.services.iactnlayer.InteractionService;
+import org.apache.isis.applib.services.user.UserMemento;
+
+import lombok.val;
+
+/**
+ * equivalent to the Spring @Transactional attribute
+ */
+public class TransactionalStepDef {
+
+    private Runnable afterScenario;
+
+    @io.cucumber.java.Before(order = PriorityPrecedence.EARLY)
+    public void beforeScenario(){
+
+        //open InteractionSession to be closed after scenario (see below)
+        interactionService.openInteraction(InteractionContext.ofUserWithSystemDefaults(UserMemento.ofName("initialization")));
+
+        val txTemplate = new TransactionTemplate(txMan);
+        val status = txTemplate.getTransactionManager().getTransaction(null);
+        afterScenario = () -> {
+            txTemplate.getTransactionManager().rollback(status);
+            interactionService.closeInteractionLayers();
+        };
+
+        status.flush();
+    }
+
+    @io.cucumber.java.After
+    public void afterScenario(){
+        if(afterScenario==null) {
+            return;
+        }
+        afterScenario.run();
+        afterScenario = null;
+    }
+
+    @Inject private InteractionService interactionService;
+    @Inject private PlatformTransactionManager txMan;
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java b/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
index 5859b65..5bd91c0 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/integtests/WebAppIntegTestAbstract.java
@@ -18,11 +18,13 @@ import org.apache.isis.testing.integtestsupport.applib.IsisIntegrationTestAbstra
 
 import domainapp.modules.simple.SimpleModule;
 import domainapp.webapp.application.ApplicationModule;
+import domainapp.webapp.bdd.stepdefs.BddStepDefsModule;
 
 @SpringBootTest(
     classes = {
             // we use a slightly different configuration compared to the production (AppManifest/webapp)
             WebAppIntegTestAbstract.TestApp.class,
+            BddStepDefsModule.class,
             ApplicationModule.class,
     }
 )
diff --git a/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/lockdown/current/.gitignore b/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/lockdown/current/.gitignore
new file mode 100644
index 0000000..b81c795
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/integtests/metamodel/lockdown/current/.gitignore
@@ -0,0 +1 @@
+*.xml
\ No newline at end of file
diff --git a/webapp-tests/src/test/java/domainapp/webapp/unittests/archunit/ArchitectureTests.java b/webapp-tests/src/test/java/domainapp/webapp/unittests/archunit/ArchitectureTests.java
new file mode 100644
index 0000000..a6af148
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/unittests/archunit/ArchitectureTests.java
@@ -0,0 +1,64 @@
+package domainapp.webapp.unittests.archunit;
+
+import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaAnnotation;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.junit.AnalyzeClasses;
+import com.tngtech.archunit.junit.ArchTest;
+import com.tngtech.archunit.lang.ArchRule;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
+import static com.tngtech.archunit.library.Architectures.layeredArchitecture;
+
+import org.apache.commons.math3.geometry.spherical.oned.Arc;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.persistence.jpa.applib.integration.IsisEntityListener;
+
+import domainapp.modules.simple.SimpleModule;
+import domainapp.webapp.SimpleApp;
+
+@AnalyzeClasses(
+        packagesOf = {SimpleModule.class, SimpleApp.class},
+        importOptions = {
+                ImportOption.DoNotIncludeTests.class
+        })
+public class ArchitectureTests {
+
+    @ArchTest
+    static ArchRule package_dependencies =
+            layeredArchitecture()
+                    .layer("simple module").definedBy("domainapp.modules.simple..")
+                    .layer("webapp").definedBy("domainapp.webapp..")
+            .whereLayer("simple module").mayOnlyBeAccessedByLayers("webapp");
+
+//    @ArchTest
+//    static ArchRule classes_annotated_with_PersistenceCapable_are_also_annotated_with_DomainObject =
+//            classes()
+//                   .that().areAnnotatedWith(PersistenceCapable.class)
+//            .should().beAnnotatedWith(DomainObject.class);
+
+//    @ArchTest
+//    static ArchRule classes_annotated_with_PersistenceCapable_are_also_annotated_with_XmlJavaTypeAdapter =
+//            classes()
+//                   .that().areAnnotatedWith(PersistenceCapable.class)
+//            .should().beAnnotatedWith(XmlJavaTypeAdapter.class);
+
+    @ArchTest
+    static ArchRule classes_annotated_with_Entity_are_also_annotated_with_EntityListeners =
+            classes()
+                   .that().areAnnotatedWith(Entity.class)
+            .should().beAnnotatedWith(EntityListeners.class);
+
+    @ArchTest
+    static ArchRule classes_annotated_with_DomainObject_are_also_annotated_with_DomainObjectLayout =
+            classes()
+                   .that().areAnnotatedWith(DomainObject.class)
+            .should().beAnnotatedWith(DomainObjectLayout.class);
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/unittests/mavendeps/lockdown/current/.gitignore b/webapp-tests/src/test/java/domainapp/webapp/unittests/mavendeps/lockdown/current/.gitignore
new file mode 100644
index 0000000..e66bc56
--- /dev/null
+++ b/webapp-tests/src/test/java/domainapp/webapp/unittests/mavendeps/lockdown/current/.gitignore
@@ -0,0 +1 @@
+*.received.txt
\ No newline at end of file
diff --git a/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_listAllAndCreate.feature b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_listAllAndCreate.feature
new file mode 100644
index 0000000..ca807b4
--- /dev/null
+++ b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_listAllAndCreate.feature
@@ -0,0 +1,14 @@
+Feature: List and Create New Simple Objects
+
+  @DomainAppDemo
+  Scenario: Existing simple objects can be listed and new ones created
+    Given there are initially 10 simple objects
+    When  I create a new simple object
+    Then  there are 11 simple objects
+
+  Scenario: When there are no objects at all
+    Given there are initially 0 simple objects
+    When  I create a new simple object
+    And   I create another new simple object
+    Then  there are 2 simple objects
+
diff --git a/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_updateName.feature b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_updateName.feature
new file mode 100644
index 0000000..1b021e2
--- /dev/null
+++ b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/SimpleObjectSpec_updateName.feature
@@ -0,0 +1,16 @@
+Feature: Can modify name (with restrictions)
+
+  @DomainAppDemo
+  Scenario: Can modify name with most characters
+    Given a simple object
+    When  I modify the name to 'abc'
+    Then  the name is now 'abc'
+
+  @DomainAppDemo
+  Scenario: Cannot modify name if has invalid character
+    Given a simple object
+    When  I attempt to change the name to 'abc&'
+    Then  the name is unchanged
+     And  a warning is raised
+
+
diff --git a/webapp-tests/src/test/resources/junit-platform.properties b/webapp-tests/src/test/resources/junit-platform.properties
new file mode 100644
index 0000000..17785d9
--- /dev/null
+++ b/webapp-tests/src/test/resources/junit-platform.properties
@@ -0,0 +1,19 @@
+# as per https://github.com/cucumber/cucumber-jvm/tree/master/junit-platform-engine#configuration-options
+cucumber.publish.quiet=true
+cucumber.filter.tags=not @backlog and not @ignore
+
+#cucumber.glue=domainapp.webapp.bdd.stepdefs
+#we are using built-in reporting plugins
+cucumber.plugin=pretty, html:target/cucumber-reports/cucumber-report.html
+
+cucumber.junit-platform.naming-strategy=long
+
+# WARNING:
+#
+# cucumber.plugin=..., json:target/cucumber-reports/cucumber-report.json, ...
+#
+# will cause an empty file to be created when running from mvn.
+#
+# this is why the maven configuration to execute cucumber using the CLI (antrun:run@cucumber-cli)
+# is configured to use --plugins json:target/cucumber-no-clobber.json
+#


[isis-app-simpleapp] 03/03: no joy yet

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch attempting-to-bring-in-bdd-specs
in repository https://gitbox.apache.org/repos/asf/isis-app-simpleapp.git

commit 70d13bc3e563ce942c4a2c40586df1d388ef0c10
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Aug 30 22:53:34 2022 +0100

    no joy yet
---
 .../webapp/bdd/specs/CucumberTestAbstract.java     |  81 ++++++++++++-
 .../testdomain/conf/Configuration_headless.java    | 130 +++++++++++++++++++++
 .../isis/testdomain/cucumber/CucumberTest.java}    |  27 +++--
 .../apache/isis/testdomain/cucumber/StepDefs.java  |  61 ++++++++++
 .../src/test/resources/application-test.properties |   8 +-
 .../webapp/bdd/specs/is_it_friday_yet.feature      |   8 ++
 .../src/test/resources/junit-platform.properties   |  27 ++++-
 .../testdomain/cucumber/is_it_friday_yet.feature   |   8 ++
 8 files changed, 333 insertions(+), 17 deletions(-)

diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
index d19ba11..2471ebe 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
+++ b/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
@@ -18,7 +18,30 @@
  */
 package domainapp.webapp.bdd.specs;
 
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.test.context.ActiveProfiles;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.apache.isis.core.config.presets.IsisPresets;
+import org.apache.isis.core.runtimeservices.IsisModuleCoreRuntimeServices;
+import org.apache.isis.persistence.jpa.eclipselink.IsisModulePersistenceJpaEclipselink;
+import org.apache.isis.security.bypass.IsisModuleSecurityBypass;
+import org.apache.isis.testing.fixtures.applib.IsisModuleTestingFixturesApplib;
+import org.apache.isis.testing.integtestsupport.applib.IsisIntegrationTestAbstract;
+
+import domainapp.modules.simple.SimpleModule;
+import domainapp.webapp.application.ApplicationModule;
 import domainapp.webapp.integtests.WebAppIntegTestAbstract;
+import io.cucumber.java.en.Given;
+import io.cucumber.java.en.Then;
+import io.cucumber.java.en.When;
 import io.cucumber.spring.CucumberContextConfiguration;
 
 /**
@@ -26,9 +49,63 @@ import io.cucumber.spring.CucumberContextConfiguration;
  * Provides the App's Spring Context for testing with Cucumber.
  *
  */
+@SpringBootTest(
+        classes = {
+                // we use a slightly different configuration compared to the production (AppManifest/webapp)
+                domainapp.webapp.integtests.WebAppIntegTestAbstract.TestApp.class,
+                BddStepDefsModule.class,
+                ApplicationModule.class,
+        }
+)
 @CucumberContextConfiguration
-public abstract class CucumberTestAbstract extends WebAppIntegTestAbstract {
+@ActiveProfiles("test")
+public abstract class CucumberTestAbstract extends IsisIntegrationTestAbstract {
+
+    /**
+     * Compared to the production app manifest <code>domainapp.webapp.AppManifest</code>,
+     * here we in effect disable security checks, and we exclude any web/UI modules.
+     */
+    @SpringBootConfiguration
+    @EnableAutoConfiguration
+    @EnableJpaRepositories
+    @Import({
+
+            IsisModuleCoreRuntimeServices.class,
+            IsisModuleSecurityBypass.class,
+            IsisModulePersistenceJpaEclipselink.class,
+            IsisModuleTestingFixturesApplib.class,
+
+            SimpleModule.class
+    })
+    @PropertySources({
+            @PropertySource(IsisPresets.H2InMemory_withUniqueSchema),
+            @PropertySource(IsisPresets.UseLog4j2Test),
+    })
+    public static class TestApp {
+
+    }
+
+    private String today;
+    private String actualAnswer;
+
+//    @Given("today is Sunday")
+//    public void today_is_sunday() {
+//        this.today = "Sunday";
+//    }
+
+    @Given("^today is (.+)$")
+    public void today_is(final String today) {
+        this.today = today;
+    }
+
+    @When("I ask whether it's Friday yet")
+    public void i_ask_whether_it_s_Friday_yet() {
+        actualAnswer = "Friday".equals(today) ? "TGIF" : "Nope";
+    }
 
-    // any cucumber specific stuff might go here
+    @Then("I should be told {string}")
+    public void i_should_be_told(final String expectedAnswer) {
+        assertEquals(expectedAnswer, actualAnswer);
+    }
 
 }
diff --git a/webapp-tests/src/test/java/org/apache/isis/testdomain/conf/Configuration_headless.java b/webapp-tests/src/test/java/org/apache/isis/testdomain/conf/Configuration_headless.java
new file mode 100644
index 0000000..ba14c24
--- /dev/null
+++ b/webapp-tests/src/test/java/org/apache/isis/testdomain/conf/Configuration_headless.java
@@ -0,0 +1,130 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.testdomain.conf;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionException;
+import org.springframework.transaction.TransactionStatus;
+
+import org.apache.isis.applib.annotation.PriorityPrecedence;
+import org.apache.isis.applib.services.iactn.Interaction;
+import org.apache.isis.applib.services.metrics.MetricsService;
+import org.apache.isis.core.config.presets.IsisPresets;
+import org.apache.isis.core.interaction.scope.TransactionBoundaryAware;
+import org.apache.isis.core.runtimeservices.IsisModuleCoreRuntimeServices;
+import org.apache.isis.security.bypass.IsisModuleSecurityBypass;
+//import org.apache.isis.testdomain.util.interaction.DomainObjectTesterFactory;
+//import org.apache.isis.testdomain.util.kv.KVStoreForTesting;
+
+import lombok.RequiredArgsConstructor;
+
+@Configuration
+@Import({
+    IsisModuleCoreRuntimeServices.class,
+    IsisModuleSecurityBypass.class,
+    Configuration_headless.HeadlessCommandSupport.class,
+//    KVStoreForTesting.class, // Helper for JUnit Tests
+//    DomainObjectTesterFactory.class // Helper for JUnit Tests
+})
+@PropertySources({
+    @PropertySource(IsisPresets.NoTranslations),
+})
+public class Configuration_headless {
+
+    @Service
+    @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
+    @RequiredArgsConstructor(onConstructor_ = {@Inject})
+    public static class HeadlessCommandSupport
+    implements TransactionBoundaryAware {
+
+        @Override
+        public void beforeEnteringTransactionalBoundary(final Interaction interaction) {
+//            _Probe.errOut("Interaction HAS_STARTED conversationId=%s", interaction.getInteractionId());
+            setupCommandCreateIfMissing();
+        }
+
+        @Override
+        public void afterLeavingTransactionalBoundary(final Interaction interaction) {
+//            _Probe.errOut("Interaction IS_ENDING conversationId=%s", interaction.getInteractionId());
+        }
+
+        public void setupCommandCreateIfMissing() {
+
+//            val interactionProvider = interactionProviderProvider.get();
+//            @SuppressWarnings("unused")
+//            final Interaction interaction = Optional.ofNullable(interactionContext.getInteraction())
+//                    .orElseGet(()->{
+//                        val newCommand = new Command();
+//                        val newInteraction = new Interaction(newCommand);
+//                        interactionProvider.setInteraction(newInteraction);
+//                        return newInteraction;
+//                    });
+        }
+
+    }
+
+    @Bean @Singleton
+    public PlatformTransactionManager platformTransactionManager() {
+        return new PlatformTransactionManager() {
+
+            @Override
+            public void rollback(final TransactionStatus status) throws TransactionException {
+            }
+
+            @Override
+            public TransactionStatus getTransaction(final TransactionDefinition definition) throws TransactionException {
+                return null;
+            }
+
+            @Override
+            public void commit(final TransactionStatus status) throws TransactionException {
+            }
+        };
+    }
+
+
+    @Bean @Singleton
+    public MetricsService metricsService() {
+        return new MetricsService() {
+
+            @Override
+            public int numberEntitiesLoaded() {
+                return 0;
+            }
+
+            @Override
+            public int numberEntitiesDirtied() {
+                return 0;
+            }
+
+        };
+    }
+
+
+}
diff --git a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java b/webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/CucumberTest.java
similarity index 51%
copy from webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
copy to webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/CucumberTest.java
index d19ba11..7a7c373 100644
--- a/webapp-tests/src/test/java/domainapp/webapp/bdd/specs/CucumberTestAbstract.java
+++ b/webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/CucumberTest.java
@@ -16,19 +16,28 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package domainapp.webapp.bdd.specs;
+package org.apache.isis.testdomain.cucumber;
+
+import org.junit.platform.suite.api.IncludeEngines;
+import org.junit.platform.suite.api.SelectClasspathResource;
+import org.junit.platform.suite.api.Suite;
 
-import domainapp.webapp.integtests.WebAppIntegTestAbstract;
-import io.cucumber.spring.CucumberContextConfiguration;
 
 /**
- *
- * Provides the App's Spring Context for testing with Cucumber.
- *
+ * Cucumber will scan this package for feature files.
+ * <p>
+ * Make sure this class name ends with Test, as Surefire when bundled with Apache Isis
+ * filters JUnit tests also by class name.
  */
-@CucumberContextConfiguration
-public abstract class CucumberTestAbstract extends WebAppIntegTestAbstract {
+@Suite
+@IncludeEngines("cucumber")
+@SelectClasspathResource("org/apache/isis/testdomain/cucumber")
+public class CucumberTest {
 
-    // any cucumber specific stuff might go here
+    // See 7.x:
+    // https://github.com/cucumber/cucumber-jvm/blob/main/release-notes/v7.0.0.md
+    // See 6.x:
+    // https://github.com/cucumber/cucumber-jvm/issues/1149
+    // https://github.com/cucumber/cucumber-jvm/tree/master/junit-platform-engine
 
 }
diff --git a/webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/StepDefs.java b/webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/StepDefs.java
new file mode 100644
index 0000000..13c587e
--- /dev/null
+++ b/webapp-tests/src/test/java/org/apache/isis/testdomain/cucumber/StepDefs.java
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.testdomain.cucumber;
+
+import org.springframework.boot.test.context.SpringBootTest;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+
+import org.apache.isis.testdomain.conf.Configuration_headless;
+
+import io.cucumber.java.en.Given;
+import io.cucumber.java.en.Then;
+import io.cucumber.java.en.When;
+import io.cucumber.spring.CucumberContextConfiguration;
+
+@CucumberContextConfiguration
+@SpringBootTest(
+        classes = {
+                Configuration_headless.class,
+        })
+public class StepDefs {
+    private String today;
+    private String actualAnswer;
+
+//    @Given("today is Sunday")
+//    public void today_is_sunday() {
+//        this.today = "Sunday";
+//    }
+
+    @Given("^today is (.+)$")
+    public void today_is(final String today) {
+        this.today = today;
+    }
+
+    @When("I ask whether it's Friday yet")
+    public void i_ask_whether_it_s_Friday_yet() {
+        actualAnswer = "Friday".equals(today) ? "TGIF" : "Nope";
+    }
+
+    @Then("I should be told {string}")
+    public void i_should_be_told(final String expectedAnswer) {
+        assertEquals(expectedAnswer, actualAnswer);
+    }
+}
diff --git a/webapp-tests/src/test/resources/application-test.properties b/webapp-tests/src/test/resources/application-test.properties
index eaf3275..7951c94 100644
--- a/webapp-tests/src/test/resources/application-test.properties
+++ b/webapp-tests/src/test/resources/application-test.properties
@@ -1,4 +1,4 @@
-eclipselink.weaving=false
-eclipselink.weaving.changetracking=false
-eclipselink.weaving.internal=false
-eclipselink.weaving.lazy=false
+#eclipselink.weaving=false
+#eclipselink.weaving.changetracking=false
+#eclipselink.weaving.internal=false
+#eclipselink.weaving.lazy=false
diff --git a/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/is_it_friday_yet.feature b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/is_it_friday_yet.feature
new file mode 100644
index 0000000..b93e94b
--- /dev/null
+++ b/webapp-tests/src/test/resources/domainapp/webapp/bdd/specs/is_it_friday_yet.feature
@@ -0,0 +1,8 @@
+Feature: Is it Friday yet?
+  Everybody wants to know when it's Friday
+
+  Scenario: Sunday isn't Friday
+    Given today is Sunday
+    When I ask whether it's Friday yet
+    Then I should be told "Nope"
+    
diff --git a/webapp-tests/src/test/resources/junit-platform.properties b/webapp-tests/src/test/resources/junit-platform.properties
index d4347d9..2d2392b 100644
--- a/webapp-tests/src/test/resources/junit-platform.properties
+++ b/webapp-tests/src/test/resources/junit-platform.properties
@@ -1,8 +1,31 @@
+## as per https://github.com/cucumber/cucumber-jvm/tree/master/junit-platform-engine#configuration-options
+#cucumber.publish.quiet=true
+#cucumber.filter.tags=not @backlog and not @ignore
+#
+#cucumber.glue=domainapp.webapp.bdd.specs
+##we are using built-in reporting plugins
+#cucumber.plugin=pretty, html:target/cucumber-reports/cucumber-report.html
+#
+#cucumber.junit-platform.naming-strategy=long
+#
+## WARNING:
+##
+## cucumber.plugin=..., json:target/cucumber-reports/cucumber-report.json, ...
+##
+## will cause an empty file to be created when running from mvn.
+##
+## this is why the maven configuration to execute cucumber using the CLI (antrun:run@cucumber-cli)
+## is configured to use --plugins json:target/cucumber-no-clobber.json
+##
+
+
+
+
 # as per https://github.com/cucumber/cucumber-jvm/tree/master/junit-platform-engine#configuration-options
 cucumber.publish.quiet=true
 cucumber.filter.tags=not @backlog and not @ignore
-
-cucumber.glue=domainapp.webapp.bdd.specs
+#we are using @Cucumber annotated classes and restrict classpath search to
+cucumber.glue=org.apache.isis.testdomain.cucumber
 #we are using built-in reporting plugins
 cucumber.plugin=pretty, html:target/cucumber-reports/cucumber-report.html
 
diff --git a/webapp-tests/src/test/resources/org/apache/isis/testdomain/cucumber/is_it_friday_yet.feature b/webapp-tests/src/test/resources/org/apache/isis/testdomain/cucumber/is_it_friday_yet.feature
new file mode 100644
index 0000000..b93e94b
--- /dev/null
+++ b/webapp-tests/src/test/resources/org/apache/isis/testdomain/cucumber/is_it_friday_yet.feature
@@ -0,0 +1,8 @@
+Feature: Is it Friday yet?
+  Everybody wants to know when it's Friday
+
+  Scenario: Sunday isn't Friday
+    Given today is Sunday
+    When I ask whether it's Friday yet
+    Then I should be told "Nope"
+