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 2026/04/24 07:49:16 UTC

(causeway) 06/28: CAUSEWAY-3989: [v2] adds tests

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

danhaywood pushed a commit to branch CAUSEWAY-3989
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit c1ee3d6de3c0a47e89744bb8291a62785326bf47
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Apr 21 13:55:02 2026 +0100

    CAUSEWAY-3989: [v2] adds tests
---
 ...mandDtoUtils_Test.commands-with-collection.yaml | 14 +-------------
 .../applib/util/schema/CommandDtoUtils_Test.java   | 22 +++++++++++++++++++---
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.commands-with-collection.yaml b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.commands-with-collection.yaml
index 7ecab590deb..f2b7b6b3b5f 100644
--- a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.commands-with-collection.yaml
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.commands-with-collection.yaml
@@ -89,16 +89,4 @@
           type: "string"
           name: "New Tag Name"
     logicalMemberIdentifier: "outgoing.lease.Lease#calculate"
-    interactionType: "action_invocation"
-- majorVersion: "2"
-  minorVersion: "0"
-  interactionId: "08c210e1-55c0-4c45-83db-491f6581e621"
-  timestamp: "2026-04-21T09:43:58.169+00:00"
-  username: "estatio-admin"
-  targets:
-    oid:
-      - type: "outgoing.invoiceforlease.InvoiceForLease"
-        id: "419264"
-  member: !<ACT>
-    logicalMemberIdentifier: "outgoing.invoiceforlease.InvoiceForLease#approve"
-    interactionType: "action_invocation"
+    interactionType: "action_invocation"
\ No newline at end of file
diff --git a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.java b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.java
index 030dec7aad3..d00b9a11678 100644
--- a/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.java
+++ b/api/applib/src/test/java/org/apache/causeway/applib/util/schema/CommandDtoUtils_Test.java
@@ -88,9 +88,8 @@ public void clearUserData() {
     }
 
     @Test
-    public void fromYaml() throws IOException {
-//        String name = "commands.yml";
-        String name = "commands-with-collection.yaml";
+    public void fromYaml_scalarValues() throws IOException {
+        String name = "commands.yaml";
         InputStream resourceAsStream = getClass().getResourceAsStream(getClass().getSimpleName() + "." + name);
         byte[] bytes = StreamUtils.copyToByteArray(resourceAsStream);
 
@@ -104,4 +103,21 @@ public void fromYaml() throws IOException {
 
         Assertions.assertThat(commandDto).hasSize(2);
     }
+
+    @Test
+    public void fromYaml_collectionValues() throws IOException {
+        String name = "commands-with-collection.yaml";
+        InputStream resourceAsStream = getClass().getResourceAsStream(getClass().getSimpleName() + "." + name);
+        byte[] bytes = StreamUtils.copyToByteArray(resourceAsStream);
+
+        Blob commandsYaml = new Blob(
+                name,
+                NamedWithMimeType.CommonMimeType.YAML.getMimeType(),
+                bytes);
+
+        var yamlDs = commandsYaml.asDataSource();
+        var commandDto = CommandDtoUtils.fromYaml(yamlDs);
+
+        Assertions.assertThat(commandDto).hasSize(1);
+    }
 }
\ No newline at end of file