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 2024/01/26 08:40:00 UTC
(causeway) 02/03: CAUSEWAY-3676: extends test domain
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-3676
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit b2a64c94ab7635b262056ff45083bbc3d63feb8c
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 26 08:29:43 2024 +0000
CAUSEWAY-3676: extends test domain
---
.../graphql/viewer/test/domain/Department.java | 19 ++
.../test/e2e/Schema_IntegTest.schema.approved.json | 201 +++++++++++++++++++++
...chema_IntegTest.schema_types_name.approved.json | 6 +
.../graphql/test/src/test/resources/schema.gql | 20 ++
4 files changed, 246 insertions(+)
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
index ac6046b59a..2c0f2e3394 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Department.java
@@ -99,6 +99,25 @@ public class Department implements Comparable<Department> {
private DeptHead deptHead;
+ @Action(semantics = SemanticsOf.IDEMPOTENT)
+ @ActionLayout(associateWith = "deptHead")
+ public class changeDeptHead {
+ public Department act(DeptHead newDeptHead) {
+ setDeptHead(newDeptHead);
+ return Department.this;
+ }
+ public DeptHead default0Act() {
+ return getDeptHead();
+ }
+ public String validate0Act(DeptHead newDeptHead) {
+ if (newDeptHead == getDeptHead()) {
+ return "Same as current";
+ }
+ return null;
+ }
+ }
+
+
@OneToMany(mappedBy = "department")
private Set<StaffMember> staffMembers = new TreeSet<>();
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
index 52c61ab6f8..41d26dd44a 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema.approved.json
@@ -22656,6 +22656,17 @@
},
"isDeprecated" : false,
"deprecationReason" : null
+ }, {
+ "name" : "changeDeptHead",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
}, {
"name" : "addStaffMember",
"description" : null,
@@ -22873,6 +22884,196 @@
"interfaces" : [ ],
"enumValues" : null,
"possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "validate",
+ "description" : null,
+ "args" : [ {
+ "name" : "newDeptHead",
+ "description" : null,
+ "type" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_DeptHead__gqlv_input",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "invokeIdempotent",
+ "description" : null,
+ "args" : [ {
+ "name" : "newDeptHead",
+ "description" : null,
+ "type" : {
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_DeptHead__gqlv_input",
+ "ofType" : null
+ }
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "params",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action_params",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action_params",
+ "description" : null,
+ "fields" : [ {
+ "name" : "newDeptHead",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter",
+ "description" : null,
+ "fields" : [ {
+ "name" : "hidden",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "Boolean",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "validity",
+ "description" : null,
+ "args" : [ {
+ "name" : "newDeptHead",
+ "description" : null,
+ "type" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_DeptHead__gqlv_input",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "autoComplete",
+ "description" : null,
+ "args" : [ {
+ "name" : "search",
+ "description" : null,
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "LIST",
+ "name" : null,
+ "ofType" : {
+ "kind" : "OBJECT",
+ "name" : "university_dept_DeptHead",
+ "ofType" : null
+ }
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "disabled",
+ "description" : null,
+ "args" : [ {
+ "name" : "newDeptHead",
+ "description" : null,
+ "type" : {
+ "kind" : "INPUT_OBJECT",
+ "name" : "university_dept_DeptHead__gqlv_input",
+ "ofType" : null
+ },
+ "defaultValue" : null
+ } ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
}, {
"kind" : "OBJECT",
"name" : "university_dept_Department__changeName__gqlv_action",
diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
index cce375c1dc..d6325f4d9a 100644
--- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
+++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Schema_IntegTest.schema_types_name.approved.json
@@ -767,6 +767,12 @@
"name" : "university_dept_Department__addStaffMember__gqlv_action_params"
}, {
"name" : "university_dept_Department__addStaffMember__staffMember__gqlv_action_parameter"
+ }, {
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action"
+ }, {
+ "name" : "university_dept_Department__changeDeptHead__gqlv_action_params"
+ }, {
+ "name" : "university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter"
}, {
"name" : "university_dept_Department__changeName__gqlv_action"
}, {
diff --git a/incubator/viewers/graphql/test/src/test/resources/schema.gql b/incubator/viewers/graphql/test/src/test/resources/schema.gql
index 250d82046b..526a1d45c9 100644
--- a/incubator/viewers/graphql/test/src/test/resources/schema.gql
+++ b/incubator/viewers/graphql/test/src/test/resources/schema.gql
@@ -2226,6 +2226,7 @@ type university_admin_AdminMenu__otherAdminAction__gqlv_action {
type university_dept_Department {
_gql_meta: university_dept_Department__gqlv_meta
addStaffMember: university_dept_Department__addStaffMember__gqlv_action
+ changeDeptHead: university_dept_Department__changeDeptHead__gqlv_action
changeName: university_dept_Department__changeName__gqlv_action
deptHead: university_dept_Department__deptHead__gqlv_property
name: university_dept_Department__name__gqlv_property
@@ -2252,6 +2253,25 @@ type university_dept_Department__addStaffMember__staffMember__gqlv_action_parame
validity(staffMember: university_dept_StaffMember__gqlv_input): String
}
+type university_dept_Department__changeDeptHead__gqlv_action {
+ disabled: String
+ hidden: Boolean
+ invokeIdempotent(newDeptHead: university_dept_DeptHead__gqlv_input!): university_dept_Department
+ params: university_dept_Department__changeDeptHead__gqlv_action_params
+ validate(newDeptHead: university_dept_DeptHead__gqlv_input): String
+}
+
+type university_dept_Department__changeDeptHead__gqlv_action_params {
+ newDeptHead: university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter
+}
+
+type university_dept_Department__changeDeptHead__newDeptHead__gqlv_action_parameter {
+ autoComplete(search: String): [university_dept_DeptHead]
+ disabled(newDeptHead: university_dept_DeptHead__gqlv_input): String
+ hidden: Boolean
+ validity(newDeptHead: university_dept_DeptHead__gqlv_input): String
+}
+
type university_dept_Department__changeName__gqlv_action {
disabled: String
hidden: Boolean