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 850db5d5d48a85e73493e1ba0c79af8002cb3e15 Author: danhaywood <[email protected]> AuthorDate: Fri Jan 26 13:17:22 2024 +0000 CAUSEWAY-3676: splits out Admin_IntegTest --- .../graphql/viewer/test/domain/Calculator.java | 25 ++ .../viewer/test/e2e/Abstract_IntegTest.java | 107 +++++++ ...min_IntegTest.action_with_disabled_param._.gql} | 0 ...gTest.action_with_disabled_param.approved.json} | 0 ...Admin_IntegTest.action_with_hidden_param._.gql} | 0 ...tegTest.action_with_hidden_param.approved.json} | 0 ...on._.gql => Admin_IntegTest.admin_action._.gql} | 0 ... => Admin_IntegTest.admin_action.approved.json} | 0 .../graphql/viewer/test/e2e/Admin_IntegTest.java | 98 +++++++ ...ql => Admin_IntegTest.other_admin_action._.gql} | 0 ...min_IntegTest.other_admin_action.approved.json} | 0 .../e2e/Domain_IntegTest.calculator_add_int._.gql | 7 + ...main_IntegTest.calculator_add_int.approved.json | 9 + .../graphql/viewer/test/e2e/Domain_IntegTest.java | 127 ++------- .../test/e2e/Schema_IntegTest.schema.approved.json | 308 +++++++++++++++++++++ ...chema_IntegTest.schema_types_name.approved.json | 10 + .../src/test/resources/application-test.properties | 4 +- .../graphql/test/src/test/resources/schema.gql | 30 ++ 18 files changed, 612 insertions(+), 113 deletions(-) diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Calculator.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Calculator.java new file mode 100644 index 0000000000..5d0feb968b --- /dev/null +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/domain/Calculator.java @@ -0,0 +1,25 @@ +package org.apache.causeway.viewer.graphql.viewer.test.domain; + +import lombok.RequiredArgsConstructor; + +import javax.annotation.Priority; +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.causeway.applib.annotation.Action; +import org.apache.causeway.applib.annotation.DomainService; +import org.apache.causeway.applib.annotation.NatureOfService; +import org.apache.causeway.applib.annotation.PriorityPrecedence; +import org.apache.causeway.applib.annotation.SemanticsOf; + +@Named("university.calc.Calculator") +@DomainService(nature= NatureOfService.VIEW) +@Priority(PriorityPrecedence.EARLY) +@RequiredArgsConstructor(onConstructor_ = {@Inject}) +public class Calculator { + + @Action(semantics = SemanticsOf.SAFE) + public int add(int x, int y) { + return x+y; + } +} diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Abstract_IntegTest.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Abstract_IntegTest.java new file mode 100644 index 0000000000..0c48f77378 --- /dev/null +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Abstract_IntegTest.java @@ -0,0 +1,107 @@ +/* + * 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.causeway.viewer.graphql.viewer.test.e2e; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import javax.inject.Inject; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; + +import org.springframework.test.context.ActiveProfiles; +import org.springframework.transaction.annotation.Propagation; + +import org.apache.causeway.applib.services.bookmark.Bookmark; +import org.apache.causeway.applib.services.bookmark.BookmarkService; +import org.apache.causeway.commons.internal.base._Strings; +import org.apache.causeway.commons.internal.collections._Maps; +import org.apache.causeway.viewer.graphql.viewer.test.CausewayViewerGraphqlTestModuleIntegTestAbstract; +import org.apache.causeway.viewer.graphql.viewer.test.domain.Department; +import org.apache.causeway.viewer.graphql.viewer.test.domain.DepartmentRepository; +import org.apache.causeway.viewer.graphql.viewer.test.domain.DeptHead; +import org.apache.causeway.viewer.graphql.viewer.test.domain.DeptHeadRepository; +import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMember; +import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMemberRepository; + +import lombok.val; + + +//NOT USING @Transactional since we are running server within same transaction otherwise +@ActiveProfiles("test") +public class Abstract_IntegTest extends CausewayViewerGraphqlTestModuleIntegTestAbstract { + + @Inject DepartmentRepository departmentRepository; + @Inject DeptHeadRepository deptHeadRepository; + @Inject StaffMemberRepository staffMemberRepository; + @Inject BookmarkService bookmarkService; + + @BeforeEach + void beforeEach(){ + transactionService.runTransactional(Propagation.REQUIRED, () -> { + + // departments + Department classics = departmentRepository.create("Classics", null); + Department physics = departmentRepository.create("Physics", null); // no head. + Department textiles = departmentRepository.create("Textiles", null); + Department pathology = departmentRepository.create("Pathology", null); + Department mathematics = departmentRepository.create("Mathematics", null); + Department civilEngineering = departmentRepository.create("Civil Engineering", null); + + // heads + deptHeadRepository.create("Dr. Barney Jones", classics); + deptHeadRepository.create("Prof. Dicky Horwich", textiles); + deptHeadRepository.create("Dr. Susan Hopwood", pathology); + deptHeadRepository.create("Dr. Helen Johansen", mathematics); + deptHeadRepository.create("Dr. George Harwood", civilEngineering); + + // staff + staffMemberRepository.create("Letitia Leadbetter", classics); + staffMemberRepository.create("Gerry Jones", classics); + staffMemberRepository.create("Mervin Hughes", physics); + staffMemberRepository.create("John Gartner", physics); + staffMemberRepository.create("Margaret Randall", physics); + + }); + } + @AfterEach + void afterEach(){ + transactionService.runTransactional(Propagation.REQUIRED, () -> { + staffMemberRepository.removeAll(); + deptHeadRepository.findAll().forEach(x -> x.setDepartment(null)); + departmentRepository.findAll().forEach(x -> x.setDeptHead(null)); + deptHeadRepository.removeAll(); + departmentRepository.removeAll(); + }); + } + + +} diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_disabled_param._.gql b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_disabled_param._.gql similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_disabled_param._.gql rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_disabled_param._.gql diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_disabled_param.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_disabled_param.approved.json similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_disabled_param.approved.json rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_disabled_param.approved.json diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_hidden_param._.gql b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_hidden_param._.gql similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_hidden_param._.gql rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_hidden_param._.gql diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_hidden_param.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_hidden_param.approved.json similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.action_with_hidden_param.approved.json rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.action_with_hidden_param.approved.json diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.admin_action._.gql b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.admin_action._.gql similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.admin_action._.gql rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.admin_action._.gql diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.admin_action.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.admin_action.approved.json similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.admin_action.approved.json rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.admin_action.approved.json diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.java new file mode 100644 index 0000000000..86fe16157a --- /dev/null +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.java @@ -0,0 +1,98 @@ +/* + * 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.causeway.viewer.graphql.viewer.test.e2e; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; + +import org.springframework.test.context.ActiveProfiles; +import org.springframework.transaction.annotation.Propagation; + +import org.apache.causeway.applib.services.bookmark.Bookmark; +import org.apache.causeway.commons.internal.base._Strings; +import org.apache.causeway.commons.internal.collections._Maps; +import org.apache.causeway.viewer.graphql.viewer.test.domain.Department; +import org.apache.causeway.viewer.graphql.viewer.test.domain.DeptHead; +import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMember; + +import lombok.val; + + +//NOT USING @Transactional since we are running server within same transaction otherwise +@ActiveProfiles("test") +public class Admin_IntegTest extends Abstract_IntegTest { + + @Test + @UseReporter(DiffReporter.class) + void admin_action() throws Exception { + + // when + val response = submit(); + + // then payload + Approvals.verify(response, jsonOptions()); + } + + @Test + @UseReporter(DiffReporter.class) + void action_with_disabled_param() throws Exception { + + // when + val response = submit(); + + // then payload + Approvals.verify(response, jsonOptions()); + } + + @Test + @UseReporter(DiffReporter.class) + void action_with_hidden_param() throws Exception { + + // when + val response = submit(); + + // then payload + Approvals.verify(response, jsonOptions()); + } + + @Test + @UseReporter(DiffReporter.class) + void other_admin_action() throws Exception { + + // when + val response = submit(); + + // then payload + Approvals.verify(response, jsonOptions()); + } + + +} diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.other_admin_action._.gql b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.other_admin_action._.gql similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.other_admin_action._.gql rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.other_admin_action._.gql diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.other_admin_action.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.other_admin_action.approved.json similarity index 100% rename from incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.other_admin_action.approved.json rename to incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Admin_IntegTest.other_admin_action.approved.json diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int._.gql b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int._.gql new file mode 100644 index 0000000000..8acaeb8670 --- /dev/null +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int._.gql @@ -0,0 +1,7 @@ +{ + university_calc_Calculator { + add { + invoke(x: 1, y: 2) + } + } +} diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int.approved.json b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int.approved.json new file mode 100644 index 0000000000..15ff5210a1 --- /dev/null +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.calculator_add_int.approved.json @@ -0,0 +1,9 @@ +{ + "data" : { + "university_calc_Calculator" : { + "add" : { + "invoke" : 3 + } + } + } +} \ No newline at end of file diff --git a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java index bf73968c5f..905088384e 100644 --- a/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java +++ b/incubator/viewers/graphql/test/src/test/java/org/apache/causeway/viewer/graphql/viewer/test/e2e/Domain_IntegTest.java @@ -18,28 +18,17 @@ */ package org.apache.causeway.viewer.graphql.viewer.test.e2e; -import lombok.val; - import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Optional; -import javax.inject.Inject; - -import org.apache.causeway.applib.services.bookmark.Bookmark; -import org.apache.causeway.applib.services.bookmark.BookmarkService; -import org.apache.causeway.commons.internal.base._Strings; -import org.apache.causeway.commons.internal.collections._Maps; -import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMember; -import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMemberRepository; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.approvaltests.Approvals; import org.approvaltests.reporters.DiffReporter; import org.approvaltests.reporters.UseReporter; import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; @@ -47,67 +36,19 @@ import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; import org.springframework.test.context.ActiveProfiles; import org.springframework.transaction.annotation.Propagation; -import org.apache.causeway.viewer.graphql.viewer.test.CausewayViewerGraphqlTestModuleIntegTestAbstract; +import org.apache.causeway.applib.services.bookmark.Bookmark; +import org.apache.causeway.commons.internal.base._Strings; +import org.apache.causeway.commons.internal.collections._Maps; import org.apache.causeway.viewer.graphql.viewer.test.domain.Department; -import org.apache.causeway.viewer.graphql.viewer.test.domain.DepartmentRepository; import org.apache.causeway.viewer.graphql.viewer.test.domain.DeptHead; -import org.apache.causeway.viewer.graphql.viewer.test.domain.DeptHeadRepository; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.causeway.viewer.graphql.viewer.test.domain.StaffMember; -import static org.apache.causeway.commons.internal.assertions._Assert.assertEquals; -import static org.apache.causeway.commons.internal.assertions._Assert.assertTrue; +import lombok.val; //NOT USING @Transactional since we are running server within same transaction otherwise @ActiveProfiles("test") -public class Domain_IntegTest extends CausewayViewerGraphqlTestModuleIntegTestAbstract { - - @Inject DepartmentRepository departmentRepository; - @Inject DeptHeadRepository deptHeadRepository; - @Inject StaffMemberRepository staffMemberRepository; - @Inject BookmarkService bookmarkService; - - @BeforeEach - void beforeEach(){ - transactionService.runTransactional(Propagation.REQUIRED, () -> { - - // departments - Department classics = departmentRepository.create("Classics", null); - Department physics = departmentRepository.create("Physics", null); // no head. - Department textiles = departmentRepository.create("Textiles", null); - Department pathology = departmentRepository.create("Pathology", null); - Department mathematics = departmentRepository.create("Mathematics", null); - Department civilEngineering = departmentRepository.create("Civil Engineering", null); - - // heads - deptHeadRepository.create("Dr. Barney Jones", classics); - deptHeadRepository.create("Prof. Dicky Horwich", textiles); - deptHeadRepository.create("Dr. Susan Hopwood", pathology); - deptHeadRepository.create("Dr. Helen Johansen", mathematics); - deptHeadRepository.create("Dr. George Harwood", civilEngineering); - - // staff - staffMemberRepository.create("Letitia Leadbetter", classics); - staffMemberRepository.create("Gerry Jones", classics); - staffMemberRepository.create("Mervin Hughes", physics); - staffMemberRepository.create("John Gartner", physics); - staffMemberRepository.create("Margaret Randall", physics); - - }); - } - @AfterEach - void afterEach(){ - transactionService.runTransactional(Propagation.REQUIRED, () -> { - staffMemberRepository.removeAll(); - deptHeadRepository.findAll().forEach(x -> x.setDepartment(null)); - departmentRepository.findAll().forEach(x -> x.setDeptHead(null)); - deptHeadRepository.removeAll(); - departmentRepository.removeAll(); - }); - } - +public class Domain_IntegTest extends Abstract_IntegTest { @Test @UseReporter(DiffReporter.class) @@ -179,6 +120,14 @@ public class Domain_IntegTest extends CausewayViewerGraphqlTestModuleIntegTestAb Approvals.verify(submit(), jsonOptions()); } + @Test + @UseReporter(DiffReporter.class) + void calculator_add_int() throws Exception { + + // when, then + Approvals.verify(submit(), jsonOptions()); + } + @Test @UseReporter(DiffReporter.class) void find_department_and_add_staff_members() throws Exception { @@ -342,50 +291,6 @@ public class Domain_IntegTest extends CausewayViewerGraphqlTestModuleIntegTestAb Approvals.verify(response, jsonOptions()); } - @Test - @UseReporter(DiffReporter.class) - void admin_action() throws Exception { - - // when - val response = submit(); - - // then payload - Approvals.verify(response, jsonOptions()); - } - - @Test - @UseReporter(DiffReporter.class) - void action_with_disabled_param() throws Exception { - - // when - val response = submit(); - - // then payload - Approvals.verify(response, jsonOptions()); - } - - @Test - @UseReporter(DiffReporter.class) - void action_with_hidden_param() throws Exception { - - // when - val response = submit(); - - // then payload - Approvals.verify(response, jsonOptions()); - } - - @Test - @UseReporter(DiffReporter.class) - void other_admin_action() throws Exception { - - // when - val response = submit(); - - // then payload - Approvals.verify(response, jsonOptions()); - } - @Test @UseReporter(DiffReporter.class) void find_depthead_and_change_name_invalid() throws Exception { 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 ba85c2457f..b2a9b6fcd4 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 @@ -92,6 +92,17 @@ }, "isDeprecated" : false, "deprecationReason" : null + }, { + "name" : "university_calc_Calculator", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "university_calc_Calculator", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null }, { "name" : "university_dept_Departments", "description" : null, @@ -22645,6 +22656,303 @@ "interfaces" : [ ], "enumValues" : null, "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "university_calc_Calculator", + "description" : null, + "fields" : [ { + "name" : "add", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__gqlv_action", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__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" : "x", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "y", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "invoke", + "description" : null, + "args" : [ { + "name" : "x", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "defaultValue" : null + }, { + "name" : "y", + "description" : null, + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "params", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__gqlv_action_params", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__gqlv_action_params", + "description" : null, + "fields" : [ { + "name" : "x", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__x__gqlv_action_parameter", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "y", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__y__gqlv_action_parameter", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "university_calc_Calculator__add__x__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" : "x", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "disabled", + "description" : null, + "args" : [ { + "name" : "x", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "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_calc_Calculator__add__y__gqlv_action_parameter", + "description" : null, + "fields" : [ { + "name" : "hidden", + "description" : null, + "args" : [ { + "name" : "x", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "validity", + "description" : null, + "args" : [ { + "name" : "y", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + } ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "disabled", + "description" : null, + "args" : [ { + "name" : "x", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "y", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Int", + "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", 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 08c8bc031a..5a9fd75724 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 @@ -759,6 +759,16 @@ "name" : "university_admin_AdminMenu__adminAction__gqlv_action" }, { "name" : "university_admin_AdminMenu__otherAdminAction__gqlv_action" + }, { + "name" : "university_calc_Calculator" + }, { + "name" : "university_calc_Calculator__add__gqlv_action" + }, { + "name" : "university_calc_Calculator__add__gqlv_action_params" + }, { + "name" : "university_calc_Calculator__add__x__gqlv_action_parameter" + }, { + "name" : "university_calc_Calculator__add__y__gqlv_action_parameter" }, { "name" : "university_dept_Department" }, { diff --git a/incubator/viewers/graphql/test/src/test/resources/application-test.properties b/incubator/viewers/graphql/test/src/test/resources/application-test.properties index 1ed5bab4ab..54fc4d657b 100644 --- a/incubator/viewers/graphql/test/src/test/resources/application-test.properties +++ b/incubator/viewers/graphql/test/src/test/resources/application-test.properties @@ -1,3 +1,3 @@ -logging.level.org.springframework=DEBUG -logging.level.graphql=DEBUG +#logging.level.org.springframework=DEBUG +#logging.level.graphql=DEBUG diff --git a/incubator/viewers/graphql/test/src/test/resources/schema.gql b/incubator/viewers/graphql/test/src/test/resources/schema.gql index 2b7fa5581b..2bdcc40dd4 100644 --- a/incubator/viewers/graphql/test/src/test/resources/schema.gql +++ b/incubator/viewers/graphql/test/src/test/resources/schema.gql @@ -28,6 +28,7 @@ type Query { causeway_security_LogoutMenu: causeway_security_LogoutMenu numServices: Int university_admin_AdminMenu: university_admin_AdminMenu + university_calc_Calculator: university_calc_Calculator university_dept_Departments: university_dept_Departments university_dept_DeptHeads: university_dept_DeptHeads university_dept_Staff: university_dept_Staff @@ -2225,6 +2226,35 @@ type university_admin_AdminMenu__otherAdminAction__gqlv_action { validate: String } +type university_calc_Calculator { + add: university_calc_Calculator__add__gqlv_action +} + +type university_calc_Calculator__add__gqlv_action { + disabled: String + hidden: Boolean + invoke(x: Int!, y: Int!): Int + params: university_calc_Calculator__add__gqlv_action_params + validate(x: Int, y: Int): String +} + +type university_calc_Calculator__add__gqlv_action_params { + x: university_calc_Calculator__add__x__gqlv_action_parameter + y: university_calc_Calculator__add__y__gqlv_action_parameter +} + +type university_calc_Calculator__add__x__gqlv_action_parameter { + disabled(x: Int): String + hidden: Boolean + validity(x: Int): String +} + +type university_calc_Calculator__add__y__gqlv_action_parameter { + disabled(x: Int, y: Int): String + hidden(x: Int): Boolean + validity(y: Int): String +} + type university_dept_Department { _gql_meta: university_dept_Department__gqlv_meta addStaffMember: university_dept_Department__addStaffMember__gqlv_action
