diff --git a/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTest.java b/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTest.java index 5958d5d7e..b80a7cfe1 100644 --- a/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTest.java +++ b/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTest.java @@ -60,11 +60,10 @@ void test_migrated_policy_working_test_legacy_policy_working( assertThat(migratedAlwaysTruePolicy.getType()).isEqualTo(UiPolicyExpressionType.EMPTY); assertThat(migratedAlwaysTruePolicy.getConstraint()).isNull(); - testTransfer(scenario, mockServer, providerClient, consumerClient); - testTransfer(scenario, mockServer, consumerClient, providerClient); + testTransfer(scenario, mockServer, consumerClient); } - public void testTransfer(E2eScenario scenario, ClientAndServer mockServer, EdcClient providerClient, EdcClient consumerClient) { + public static void testTransfer(E2eScenario scenario, ClientAndServer mockServer, EdcClient consumerClient) { // arrange val destinationPath = "/destination/some/path/"; val destinationUrl = "http://localhost:" + mockServer.getPort() + destinationPath; diff --git a/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTestReversed.java b/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTestReversed.java new file mode 100644 index 000000000..8046a9f48 --- /dev/null +++ b/tests/src/test/java/de/sovity/edc/e2e/AlwaysTrueMigrationTestReversed.java @@ -0,0 +1,35 @@ +package de.sovity.edc.e2e; + +import de.sovity.edc.client.EdcClient; +import de.sovity.edc.extension.e2e.extension.Consumer; +import de.sovity.edc.extension.e2e.extension.E2eScenario; +import de.sovity.edc.extension.e2e.extension.E2eTestExtension; +import de.sovity.edc.extension.e2e.extension.Provider; +import de.sovity.edc.extension.utils.junit.DisabledOnGithub; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.mockserver.integration.ClientAndServer; + +import static de.sovity.edc.e2e.AlwaysTrueMigrationTest.testTransfer; +import static org.assertj.core.api.Assertions.assertThat; + +class AlwaysTrueMigrationTestReversed { + + @RegisterExtension + private static final E2eTestExtension E2E_TEST_EXTENSION = E2eTestExtension.builder() + .additionalConsumerMigrationLocation("classpath:db/additional-test-data/always-true-policy-legacy") + .additionalProviderMigrationLocation("classpath:db/additional-test-data/always-true-policy-migrated") + .build(); + + @Test + @DisabledOnGithub + void test_migrated_policy_working_test_legacy_policy_working( + E2eScenario scenario, + ClientAndServer mockServer, + @Provider EdcClient providerClient, + @Consumer EdcClient consumerClient + ) { + // assert correct policies + testTransfer(scenario, mockServer, consumerClient); + } +}