Skip to content

Commit

Permalink
review-remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Oct 2, 2024
1 parent da06a40 commit 4fec49e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 26 deletions.
33 changes: 23 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ val getJars by tasks.registering(Copy::class) {
outputs.upToDateWhen { false } //always download

from(downloadArtifact)
// strip away the version string
.rename { s ->
s.replace("-${identityHubVersion}", "")
.replace("-${registrationServiceVersion}", "")
.replace("-all", "")
}
// strip away the version string
.rename { s ->
s.replace("-${identityHubVersion}", "")
.replace("-${registrationServiceVersion}", "")
.replace("-all", "")
}
into(layout.projectDirectory.dir("libs/cli-tools"))
}

Expand Down Expand Up @@ -101,7 +101,8 @@ allprojects {
}
}
maven {
url = uri("https://pkgs.dev.azure.com/sovity/41799556-91c8-4df6-8ddb-4471d6f15953/_packaging/core-edc/maven/v1")
url =
uri("https://pkgs.dev.azure.com/sovity/41799556-91c8-4df6-8ddb-4471d6f15953/_packaging/core-edc/maven/v1")
name = "AzureRepo"
}
}
Expand Down Expand Up @@ -137,8 +138,20 @@ subprojects {
withJavadocJar()
}

tasks.withType<Javadoc> {
val fullOptions = options as StandardJavadocDocletOptions
fullOptions.addStringOption("Xdoclint:none", "-quiet")
tasks.withType<Javadoc>().configureEach {
options {
val fullOptions = options as StandardJavadocDocletOptions
fullOptions.addStringOption("Xdoclint:none", "-quiet")
// Include Lombok-generated methods in the documentation
fullOptions.addBooleanOption("-A", true)
}

// Ensure Lombok processor is available during JavaDoc generation
doFirst {
configurations.compileClasspath.get().forEach { file ->
val fullOptions = options as StandardJavadocDocletOptions
fullOptions.addStringOption("classpath", file.absolutePath)
}
}
}
}
3 changes: 1 addition & 2 deletions config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ dependencies {
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)

api(libs.edc.bootSpi)

api(libs.edc.boot)

testAnnotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public static String urlPathJoin(String... parts) {
.filter(Objects::nonNull)
.filter(it -> !it.isEmpty())
.reduce("", (cur, add) -> {
// Special Case: https://
if (add.contains("://")) {
return add;
}

// Join with a single slash
if (cur.endsWith("/") && add.startsWith("/")) {
return cur + add.substring(1);
Expand Down
21 changes: 14 additions & 7 deletions config/src/test/java/UrlPathUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ void urlPathJoin_absolute() {
assertThat(urlPathJoin("/a/", "/b")).isEqualTo("/a/b");
}

@Test
void urlPathJoin_immediate_protocol() {
assertThat(urlPathJoin("https://")).isEqualTo("https://");
assertThat(urlPathJoin("https://", "b")).isEqualTo("https://b");
assertThat(urlPathJoin("https://", "/b")).isEqualTo("https://b");
}

@Test
void urlPathJoin_protocol() {
assertThat(urlPathJoin("https://a")).isEqualTo("https://a");
Expand All @@ -56,12 +63,12 @@ void urlPathJoin_protocol() {
}

@Test
void urlPathJoin_protocol_overrules_previous_segment() {
assertThat(urlPathJoin("https://ignored", "https://a")).isEqualTo("https://a");
assertThat(urlPathJoin("https://ignored", "https://a/")).isEqualTo("https://a/");
assertThat(urlPathJoin("https://ignored", "https://a", "b")).isEqualTo("https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a/", "b")).isEqualTo("https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a", "/b")).isEqualTo("https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a/", "/b")).isEqualTo("https://a/b");
void urlPathJoin_protocol_overruling_not_enabled() {
assertThat(urlPathJoin("https://ignored", "https://a")).isEqualTo("https://ignored/https://a");
assertThat(urlPathJoin("https://ignored", "https://a/")).isEqualTo("https://ignored/https://a/");
assertThat(urlPathJoin("https://ignored", "https://a", "b")).isEqualTo("https://ignored/https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a/", "b")).isEqualTo("https://ignored/https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a", "/b")).isEqualTo("https://ignored/https://a/b");
assertThat(urlPathJoin("https://ignored", "https://a/", "/b")).isEqualTo("https://ignored/https://a/b");
}
}
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ edc-apiObservability = { module = "org.eclipse.edc:api-observability", version.r
edc-authSpi = { module = "org.eclipse.edc:auth-spi", version.ref = "edc" }
edc-authTokenbased = { module = "org.eclipse.edc:auth-tokenbased", version.ref = "edc" }
edc-boot = { module = "org.eclipse.edc:boot", version.ref = "edc" }
edc-bootSpi = { module = "org.eclipse.edc:boot", version.ref = "edc" }
edc-configurationFilesystem = { module = "org.eclipse.edc:configuration-filesystem", version.ref = "edc" }
edc-connectorCore = { module = "org.eclipse.edc:connector-core", version.ref = "edc" }
edc-contractDefinitionApi = { module = "org.eclipse.edc:contract-definition-api", version.ref = "edc" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import de.sovity.edc.extension.e2e.db.TestDatabase;
import de.sovity.edc.utils.config.ConfigProps;
import de.sovity.edc.utils.config.ConfigService;
import de.sovity.edc.utils.config.model.ConfigProp;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.val;
Expand All @@ -35,7 +36,18 @@ public class ConnectorConfigFactory {

private static final Random RANDOM = new Random();

public static ConnectorConfig forTestDatabase(String participantId, TestDatabase testDatabase) {
public static ConnectorConfig forTestDatabase(
String participantId,
TestDatabase testDatabase
) {
return forTestDatabase(participantId, testDatabase, Map.of());
}

public static ConnectorConfig forTestDatabase(
String participantId,
TestDatabase testDatabase,
Map<ConfigProp, String> overrides
) {
val firstPort = getFreePortRange(5);

// The initialization of the Map is split into several statements
Expand Down Expand Up @@ -65,6 +77,8 @@ public static ConnectorConfig forTestDatabase(String participantId, TestDatabase
ConfigProps.MY_EDC_MAINTAINER_NAME, "Maintainer Name %s".formatted(participantId)
));

propertiesInput.putAll(overrides);

var properties = ConfigService.applyDefaults(propertiesInput, ConfigProps.ALL_CE_PROPS);

return ConnectorConfig.builder()
Expand Down

0 comments on commit 4fec49e

Please sign in to comment.