From cdc64be46cc5fb8350f64bd6c3dd01878271c551 Mon Sep 17 00:00:00 2001 From: Emilia Jaser Date: Mon, 16 Dec 2024 17:29:25 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20(org):=20Try=20to=20pass=20Organiza?= =?UTF-8?q?tionResourceTests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/hopps/org/rest/OrganizationResourceTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/app.hopps.org/src/test/java/app/hopps/org/rest/OrganizationResourceTests.java b/backend/app.hopps.org/src/test/java/app/hopps/org/rest/OrganizationResourceTests.java index d3620382..165304d9 100644 --- a/backend/app.hopps.org/src/test/java/app/hopps/org/rest/OrganizationResourceTests.java +++ b/backend/app.hopps.org/src/test/java/app/hopps/org/rest/OrganizationResourceTests.java @@ -1,10 +1,10 @@ package app.hopps.org.rest; import app.hopps.org.jpa.Organization; +import app.hopps.org.jpa.OrganizationRepository; import app.hopps.org.rest.model.NewOrganizationInput; import app.hopps.org.rest.model.OrganizationInput; import app.hopps.org.rest.model.OwnerInput; -import io.quarkus.narayana.jta.QuarkusTransaction; import io.quarkus.test.common.http.TestHTTPEndpoint; import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; @@ -17,10 +17,8 @@ import java.net.MalformedURLException; import java.net.URI; -import java.util.Collections; import static io.restassured.RestAssured.given; -import static io.restassured.RestAssured.when; import static org.hamcrest.Matchers.*; @QuarkusTest @@ -30,6 +28,9 @@ class OrganizationResourceTests { @Inject Flyway flyway; + @Inject + OrganizationRepository organizationRepository; + @BeforeEach public void cleanDatabase() { flyway.clean(); @@ -78,6 +79,8 @@ void shouldInvalidateVereinWithoutName() { @Test void shouldStartCreatingOrganization() throws MalformedURLException { + organizationRepository.deleteAll(); + OrganizationInput organizationInput = new OrganizationInput("Schützenverein", "schuetzenverein", Organization.TYPE.EINGETRAGENER_VEREIN, URI.create("https://hopps.cloud").toURL(), URI.create("https://hopps.cloud").toURL(), null);