From 8352d50b8a9969b7d4d2aa42183d6c394457e0d2 Mon Sep 17 00:00:00 2001 From: srishti Date: Tue, 17 Dec 2024 10:16:02 +0100 Subject: [PATCH] EA-4015 move IT --- set-integration-testing/pom.xml | 5 +++++ .../integration/client}/BaseAPIConnectionTest.java | 4 +--- .../integration/client}/BaseWebUserSetProtocol.java | 2 +- .../client}/ClientConfigurationTest.java | 2 +- .../client}/WebUserSetProtocolExceptionsTest.java | 3 +-- .../integration/client}/WebUserSetProtocolTest.java | 13 ++++++------- .../resources/content/userset-open.json | 0 .../resources/content/userset.json | 0 .../resources/content/usersetupdate.json | 0 9 files changed, 15 insertions(+), 14 deletions(-) rename {set-client/src/test/java/eu/europeana/set/client/integration/web => set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client}/BaseAPIConnectionTest.java (89%) rename {set-client/src/test/java/eu/europeana/set/client/integration/web => set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client}/BaseWebUserSetProtocol.java (98%) rename {set-client/src/test/java/eu/europeana/set/client/integration/web => set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client}/ClientConfigurationTest.java (93%) rename {set-client/src/test/java/eu/europeana/set/client/integration/web => set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client}/WebUserSetProtocolExceptionsTest.java (98%) rename {set-client/src/test/java/eu/europeana/set/client/integration/web => set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client}/WebUserSetProtocolTest.java (82%) rename {set-client/src/test => set-integration-testing/src/integration-test}/resources/content/userset-open.json (100%) rename {set-client/src/test => set-integration-testing/src/integration-test}/resources/content/userset.json (100%) rename {set-client/src/test => set-integration-testing/src/integration-test}/resources/content/usersetupdate.json (100%) diff --git a/set-integration-testing/pom.xml b/set-integration-testing/pom.xml index 10951584..d2046cde 100644 --- a/set-integration-testing/pom.xml +++ b/set-integration-testing/pom.xml @@ -48,6 +48,11 @@ set-common 1.0-SNAPSHOT + + eu.europeana.set + set-client + 1.0-SNAPSHOT + org.springframework.boot spring-boot-starter-web diff --git a/set-client/src/test/java/eu/europeana/set/client/integration/web/BaseAPIConnectionTest.java b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseAPIConnectionTest.java similarity index 89% rename from set-client/src/test/java/eu/europeana/set/client/integration/web/BaseAPIConnectionTest.java rename to set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseAPIConnectionTest.java index 615f5155..b0bb0c77 100644 --- a/set-client/src/test/java/eu/europeana/set/client/integration/web/BaseAPIConnectionTest.java +++ b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseAPIConnectionTest.java @@ -1,14 +1,12 @@ -package eu.europeana.set.client.integration.web; +package eu.europeana.api.set.integration.client; import eu.europeana.set.client.connection.BaseApiConnection; import eu.europeana.set.definitions.model.vocabulary.WebUserSetFields; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; -@Disabled("needs configuration file") public class BaseAPIConnectionTest { private static final String SERVICE_URI = "testUri"; private static final String API_KEY_1 = "api_key"; diff --git a/set-client/src/test/java/eu/europeana/set/client/integration/web/BaseWebUserSetProtocol.java b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseWebUserSetProtocol.java similarity index 98% rename from set-client/src/test/java/eu/europeana/set/client/integration/web/BaseWebUserSetProtocol.java rename to set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseWebUserSetProtocol.java index 32475a8d..26eaeb75 100644 --- a/set-client/src/test/java/eu/europeana/set/client/integration/web/BaseWebUserSetProtocol.java +++ b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/BaseWebUserSetProtocol.java @@ -1,4 +1,4 @@ -package eu.europeana.set.client.integration.web; +package eu.europeana.api.set.integration.client; import java.io.BufferedReader; import java.io.IOException; diff --git a/set-client/src/test/java/eu/europeana/set/client/integration/web/ClientConfigurationTest.java b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/ClientConfigurationTest.java similarity index 93% rename from set-client/src/test/java/eu/europeana/set/client/integration/web/ClientConfigurationTest.java rename to set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/ClientConfigurationTest.java index d75d23eb..819cf486 100644 --- a/set-client/src/test/java/eu/europeana/set/client/integration/web/ClientConfigurationTest.java +++ b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/ClientConfigurationTest.java @@ -1,4 +1,4 @@ -package eu.europeana.set.client.integration.web; +package eu.europeana.api.set.integration.client; import eu.europeana.set.client.config.ClientConfiguration; import org.apache.commons.lang3.StringUtils; diff --git a/set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolExceptionsTest.java b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolExceptionsTest.java similarity index 98% rename from set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolExceptionsTest.java rename to set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolExceptionsTest.java index 80ec719d..5c9a340c 100644 --- a/set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolExceptionsTest.java +++ b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolExceptionsTest.java @@ -1,4 +1,4 @@ -package eu.europeana.set.client.integration.web; +package eu.europeana.api.set.integration.client; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; @@ -14,7 +14,6 @@ * * @author GrafR */ -@Disabled public class WebUserSetProtocolExceptionsTest extends BaseWebUserSetProtocol { public String CORRUPTED_JSON = diff --git a/set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolTest.java b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolTest.java similarity index 82% rename from set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolTest.java rename to set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolTest.java index 138b8920..8ffe6469 100644 --- a/set-client/src/test/java/eu/europeana/set/client/integration/web/WebUserSetProtocolTest.java +++ b/set-integration-testing/src/integration-test/java/eu/europeana/api/set/integration/client/WebUserSetProtocolTest.java @@ -1,4 +1,4 @@ -package eu.europeana.set.client.integration.web; +package eu.europeana.api.set.integration.client; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -14,12 +14,11 @@ * This is an integration test, and it is ignored for unit testing * @author GrafR */ -@Disabled public class WebUserSetProtocolTest extends BaseWebUserSetProtocol { @Test public void createUserSet() throws SetApiClientException, IOException { - String setId = createTestUserSet(USER_SET_CONTENT, null); + String setId = createTestUserSet(BaseWebUserSetProtocol.USER_SET_CONTENT, null); assertNotNull(setId); apiClient.getWebUserSetApi().deleteUserSet(setId); } @@ -31,7 +30,7 @@ public void createUserSet() throws SetApiClientException, IOException { */ @Test public void retrieveUserSet() throws IllegalArgumentException, IOException, SetApiClientException { - String testSetId = createTestUserSet(USER_SET_CONTENT, null); + String testSetId = createTestUserSet(BaseWebUserSetProtocol.USER_SET_CONTENT, null); assertNotNull(testSetId); // get user set by ID and user identifier UserSet userSet = apiClient.getWebUserSetApi().getUserSet(testSetId, null); @@ -41,10 +40,10 @@ public void retrieveUserSet() throws IllegalArgumentException, IOException, SetA @Test public void updateUserSet() throws IOException, SetApiClientException { - String testSetId = createTestUserSet(USER_SET_CONTENT, null); + String testSetId = createTestUserSet(BaseWebUserSetProtocol.USER_SET_CONTENT, null); assertNotNull(testSetId); // updated user set value - String requestBody = getJsonStringInput(USER_SET_UPDATE_CONTENT); + String requestBody = getJsonStringInput(BaseWebUserSetProtocol.USER_SET_UPDATE_CONTENT); assertNotNull(requestBody); // update user set by identifier URL UserSet updateResponse = apiClient.getWebUserSetApi().updateUserSet( @@ -55,7 +54,7 @@ public void updateUserSet() throws IOException, SetApiClientException { @Test public void deleteUserSet() throws IOException, SetApiClientException { - String testSetId = createTestUserSet(USER_SET_CONTENT,null); + String testSetId = createTestUserSet(BaseWebUserSetProtocol.USER_SET_CONTENT,null); assertNotNull(testSetId); // delete user set by identifier URL String deleteResponse = apiClient.getWebUserSetApi().deleteUserSet(testSetId); diff --git a/set-client/src/test/resources/content/userset-open.json b/set-integration-testing/src/integration-test/resources/content/userset-open.json similarity index 100% rename from set-client/src/test/resources/content/userset-open.json rename to set-integration-testing/src/integration-test/resources/content/userset-open.json diff --git a/set-client/src/test/resources/content/userset.json b/set-integration-testing/src/integration-test/resources/content/userset.json similarity index 100% rename from set-client/src/test/resources/content/userset.json rename to set-integration-testing/src/integration-test/resources/content/userset.json diff --git a/set-client/src/test/resources/content/usersetupdate.json b/set-integration-testing/src/integration-test/resources/content/usersetupdate.json similarity index 100% rename from set-client/src/test/resources/content/usersetupdate.json rename to set-integration-testing/src/integration-test/resources/content/usersetupdate.json