From 4b1f1b285f58d5b6a532faf609e9deadeec92906 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Mon, 8 Jul 2024 15:16:10 +0200 Subject: [PATCH] fix tests --- edc-tests/edc-controlplane/catalog-tests/build.gradle.kts | 2 ++ edc-tests/edc-controlplane/edr-api-tests/build.gradle.kts | 2 ++ edc-tests/edc-controlplane/iatp-tests/build.gradle.kts | 2 ++ edc-tests/edc-controlplane/policy-tests/build.gradle.kts | 1 + gradle/libs.versions.toml | 2 +- .../edc/samples/multitenancy/MultiTenantRuntimeTest.java | 4 +++- samples/multi-tenancy/src/test/resources/tenants.properties | 5 ++++- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/edc-tests/edc-controlplane/catalog-tests/build.gradle.kts b/edc-tests/edc-controlplane/catalog-tests/build.gradle.kts index 42771ae1d..d3d9d8ba4 100644 --- a/edc-tests/edc-controlplane/catalog-tests/build.gradle.kts +++ b/edc-tests/edc-controlplane/catalog-tests/build.gradle.kts @@ -29,6 +29,8 @@ dependencies { testImplementation(libs.edc.junit) testImplementation(libs.restAssured) testImplementation(libs.awaitility) + testRuntimeOnly(libs.edc.transaction.local) + } // do not publish diff --git a/edc-tests/edc-controlplane/edr-api-tests/build.gradle.kts b/edc-tests/edc-controlplane/edr-api-tests/build.gradle.kts index 42771ae1d..d3d9d8ba4 100644 --- a/edc-tests/edc-controlplane/edr-api-tests/build.gradle.kts +++ b/edc-tests/edc-controlplane/edr-api-tests/build.gradle.kts @@ -29,6 +29,8 @@ dependencies { testImplementation(libs.edc.junit) testImplementation(libs.restAssured) testImplementation(libs.awaitility) + testRuntimeOnly(libs.edc.transaction.local) + } // do not publish diff --git a/edc-tests/edc-controlplane/iatp-tests/build.gradle.kts b/edc-tests/edc-controlplane/iatp-tests/build.gradle.kts index bd42ed85a..a2e3f5c65 100644 --- a/edc-tests/edc-controlplane/iatp-tests/build.gradle.kts +++ b/edc-tests/edc-controlplane/iatp-tests/build.gradle.kts @@ -34,6 +34,8 @@ dependencies { testImplementation(libs.edc.core.token) testImplementation(libs.edc.identity.vc.ldp) testImplementation(libs.edc.lib.jws2020) + testRuntimeOnly(libs.edc.transaction.local) + // 3rd party libs testImplementation(libs.netty.mockserver) testImplementation(libs.restAssured) diff --git a/edc-tests/edc-controlplane/policy-tests/build.gradle.kts b/edc-tests/edc-controlplane/policy-tests/build.gradle.kts index 42771ae1d..f8f1ae8b0 100644 --- a/edc-tests/edc-controlplane/policy-tests/build.gradle.kts +++ b/edc-tests/edc-controlplane/policy-tests/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { testImplementation(libs.edc.junit) testImplementation(libs.restAssured) testImplementation(libs.awaitility) + testRuntimeOnly(libs.edc.transaction.local) } // do not publish diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ec4fc7b30..021080993 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -231,6 +231,6 @@ titaniumJsonLd = { module = "com.apicatalog:titanium-json-ld", version.ref = "ti [bundles] edc-connector = ["edc.boot", "edc.core-connector", "edc.core-controlplane", "edc.api-observability"] edc-dpf = ["edc.dpf-transfer-signaling", "edc.dpf-selector-core", "edc.spi-dataplane-selector"] -edc-sqlstores = ["edc.sql-assetindex", "edc.sql-contract-definition", "edc.sql-contract-negotiation", "edc.sql-transferprocess", "edc.sql-policydef", "edc.sql-policy-monitor", "edc.sql-edrindex"] +edc-sqlstores = ["edc.sql-assetindex", "edc.sql-contract-definition", "edc.sql-contract-negotiation", "edc.sql-transferprocess", "edc.sql-policydef", "edc.sql-policy-monitor", "edc.sql-edrindex", "edc-transaction-local"] edc-monitoring = ["edc.micrometer-core", "edc.micrometer-jersey", "edc.micrometer-jetty"] edc-sts = ["edc-identity-trust-sts-core", "edc-identity-trust-sts-api", "edc-identity-trust-sts-client-configuration"] diff --git a/samples/multi-tenancy/src/test/java/org/eclipse/tractusx/edc/samples/multitenancy/MultiTenantRuntimeTest.java b/samples/multi-tenancy/src/test/java/org/eclipse/tractusx/edc/samples/multitenancy/MultiTenantRuntimeTest.java index 8b4272de6..4ec53ffab 100644 --- a/samples/multi-tenancy/src/test/java/org/eclipse/tractusx/edc/samples/multitenancy/MultiTenantRuntimeTest.java +++ b/samples/multi-tenancy/src/test/java/org/eclipse/tractusx/edc/samples/multitenancy/MultiTenantRuntimeTest.java @@ -26,11 +26,13 @@ import org.mockito.ArgumentMatcher; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; class MultiTenantRuntimeTest { @@ -60,7 +62,7 @@ void throwsExceptionIfTenantsFileDoesNotExist() { @Test void threadForEveryTenant() { System.setProperty("edc.tenants.path", "./src/test/resources/tenants.properties"); - + when(monitor.withPrefix(anyString())).thenReturn(monitor); runtime.boot(false); verify(monitor, times(2)).info(argThat(connectorIsReady())); diff --git a/samples/multi-tenancy/src/test/resources/tenants.properties b/samples/multi-tenancy/src/test/resources/tenants.properties index edaece1d6..d1cb1bbdb 100644 --- a/samples/multi-tenancy/src/test/resources/tenants.properties +++ b/samples/multi-tenancy/src/test/resources/tenants.properties @@ -16,7 +16,6 @@ # # SPDX-License-Identifier: Apache-2.0 ################################################################################# - edc.tenants.one.edc.any=any edc.tenants.one.web.http.port=18181 edc.tenants.one.web.http.path=/api @@ -26,6 +25,8 @@ edc.tenants.one.web.http.control.port=18283 edc.tenants.one.web.http.control.path=/control edc.tenants.one.web.http.management.port=18284 edc.tenants.one.web.http.management.path=/management +edc.tenants.one.web.http.catalog.port=18285 +edc.tenants.one.web.http.catalog.path=/catalog edc.tenants.one.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com edc.tenants.one.edc.iam.issuer.id=did:web:tenant1 edc.tenants.two.edc.any=any @@ -37,5 +38,7 @@ edc.tenants.two.web.http.control.port=28283 edc.tenants.two.web.http.control.path=/control edc.tenants.two.web.http.management.port=28284 edc.tenants.two.web.http.management.path=/management +edc.tenants.two.web.http.catalog.port=28285 +edc.tenants.two.web.http.catalog.path=/catalog edc.tenants.two.tx.edc.iam.iatp.bdrs.server.url=http://bdrs.test.com edc.tenants.two.edc.iam.issuer.id=did:web:tenant2