From 13e463aa9ce7ca0001378db70e7b016bfd6f25f6 Mon Sep 17 00:00:00 2001 From: jonathan zollinger Date: Mon, 9 Mar 2026 15:31:10 -0600 Subject: [PATCH 1/2] refactor(test): make test auth client more clear --- core/src/test/resources/application-test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/test/resources/application-test.yaml b/core/src/test/resources/application-test.yaml index a923d6d..0a25b6f 100644 --- a/core/src/test/resources/application-test.yaml +++ b/core/src/test/resources/application-test.yaml @@ -3,6 +3,8 @@ micronaut: services: justserve: url: https://stage.justserve.org +justserve: + token: ${:i-need-to-be-defined} logger: levels: io.micronaut.http.client: DEBUG From 488cd8ec325258e3fc9f43f80adb5a1197528ef5 Mon Sep 17 00:00:00 2001 From: HMS-Victory <90852625+hms-victory@users.noreply.github.com> Date: Tue, 10 Mar 2026 07:49:19 -0600 Subject: [PATCH 2/2] test: support add project attachments --- .../org/justserve/GraphQLClientSpec.groovy | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/core/src/test/groovy/org/justserve/GraphQLClientSpec.groovy b/core/src/test/groovy/org/justserve/GraphQLClientSpec.groovy index 02a2896..2e9d554 100644 --- a/core/src/test/groovy/org/justserve/GraphQLClientSpec.groovy +++ b/core/src/test/groovy/org/justserve/GraphQLClientSpec.groovy @@ -2,9 +2,14 @@ package org.justserve import io.micronaut.test.extensions.spock.annotation.MicronautTest import jakarta.inject.Inject +import net.datafaker.Faker import org.justserve.client.GraphQLClient import org.justserve.model.EventType +import org.justserve.model.GraphQLCreateProjectData import org.justserve.model.GraphQLCreateProjectVariables +import org.justserve.model.GraphQLResponse +import org.justserve.model.GraphQLSetProjectLocationVariables +import org.justserve.model.GraphQLSetProjectLocationVariablesLocationData import org.justserve.model.ProjectLocationType import spock.lang.Shared import spock.lang.Specification @@ -16,6 +21,18 @@ class GraphQLClientSpec extends Specification { @Inject GraphQLClient client + @Shared + GraphQLResponse projectData + + def setupSpec() { + GraphQLCreateProjectVariables createProjectArgs = new GraphQLCreateProjectVariables() + .setEventType(EventType.DTL) + .setLocationType(ProjectLocationType.SINGLE_LOCATION) + .setTitle("this is my title") + .setRedirect("https://google.com") + projectData = client.createProject(createProjectArgs) + } + void "can create Project with EventType: #eventType, LocationType: #locationType, and Redirect: #redirect"(EventType eventType, ProjectLocationType locationType, String redirect) { given: GraphQLCreateProjectVariables args = new GraphQLCreateProjectVariables() @@ -26,11 +43,45 @@ class GraphQLClientSpec extends Specification { when: client.createProject(args) - then: noExceptionThrown() where: [eventType, locationType, redirect] << [EventType.values(), ProjectLocationType.values(), ["", null, "https://google.com"]].combinations() } + + void "can set project location using Project Id: #projectId, Location: #location, Location Data: #locationData"(UUID projectId, String location, GraphQLSetProjectLocationVariablesLocationData locationData) { + given: + GraphQLSetProjectLocationVariables addAttachmentArgs = new GraphQLSetProjectLocationVariables() + .setProjectId(projectId) + .setLocation(location) + .setLocationData(locationData) + + when: + + client.setProjectLocation(addAttachmentArgs) + + then: + noExceptionThrown() + + where: +// TODO: Replace hardcoded values to make this a bit more dynamic + [projectId, location, locationData] << [projectData.data.createProject.id, ["20 West 6th Street, Tempe, Arizona, United States", null, ""], [null, new GraphQLSetProjectLocationVariablesLocationData() + .setAddress("20 West 6th Street") + .setAreaId("790052") + .setCcId("543306") + .setCity("Tempe") + .setCountry("United States") + .setCountryCode("us") + .setCounty("Maricopa County") + .setLocationDetails("") + .setLocationName("20 West 6th Street, Tempe, Arizona, United States") + .setLatitude(33.4245772) + .setLongitude(-111.9410241) + .setMissionId("2011050") + .setPostal("85281") + .setStakeId("504297") + .setState("Arizona") + ]].combinations() + } }