Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Jul 24, 2024
1 parent deccc75 commit fb4acff
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit fb4acff

Please sign in to comment.