Skip to content

Commit

Permalink
Add jsr310 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ununhexium committed Oct 30, 2024
1 parent e04b1a4 commit f518fb0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 74 deletions.
74 changes: 0 additions & 74 deletions config/src/test/java/UrlPathUtilsTest.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (c) 2024 sovity GmbH
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* sovity GmbH - initial API and implementation
*
*/

package de.sovity.edc.utils.config.utils;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import static de.sovity.edc.utils.config.utils.UrlPathUtils.urlPathJoin;

class UrlPathUtilsTest {
@Test
void urlPathJoin_empty() {
Assertions.assertThat(urlPathJoin()).isEmpty();
Assertions.assertThat(urlPathJoin("")).isEmpty();
Assertions.assertThat(urlPathJoin("/")).isEqualTo("/");
}

@Test
void urlPathJoin_relative() {
Assertions.assertThat(urlPathJoin("a")).isEqualTo("a");
Assertions.assertThat(urlPathJoin("a/")).isEqualTo("a/");
Assertions.assertThat(urlPathJoin("a", "b")).isEqualTo("a/b");
Assertions.assertThat(urlPathJoin("a/", "b")).isEqualTo("a/b");
Assertions.assertThat(urlPathJoin("a", "/b")).isEqualTo("a/b");
Assertions.assertThat(urlPathJoin("a/", "/b")).isEqualTo("a/b");
}

@Test
void urlPathJoin_absolute() {
Assertions.assertThat(urlPathJoin("/a")).isEqualTo("/a");
Assertions.assertThat(urlPathJoin("/a/")).isEqualTo("/a/");
Assertions.assertThat(urlPathJoin("/a", "b")).isEqualTo("/a/b");
Assertions.assertThat(urlPathJoin("/a/", "b")).isEqualTo("/a/b");
Assertions.assertThat(urlPathJoin("/a", "/b")).isEqualTo("/a/b");
Assertions.assertThat(urlPathJoin("/a/", "/b")).isEqualTo("/a/b");
}

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

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

@Test
void urlPathJoin_protocol_overruling_not_enabled() {
Assertions.assertThat(urlPathJoin("https://ignored", "https://a")).isEqualTo("https://ignored/https://a");
Assertions.assertThat(urlPathJoin("https://ignored", "https://a/")).isEqualTo("https://ignored/https://a/");
Assertions.assertThat(urlPathJoin("https://ignored", "https://a", "b")).isEqualTo("https://ignored/https://a/b");
Assertions.assertThat(urlPathJoin("https://ignored", "https://a/", "b")).isEqualTo("https://ignored/https://a/b");
Assertions.assertThat(urlPathJoin("https://ignored", "https://a", "/b")).isEqualTo("https://ignored/https://a/b");
Assertions.assertThat(urlPathJoin("https://ignored", "https://a/", "/b")).isEqualTo("https://ignored/https://a/b");
}
}
2 changes: 2 additions & 0 deletions extensions/sovity-messenger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dependencies {
implementation(libs.edc.managementApiConfiguration)
implementation(libs.edc.transformLib)

implementation(libs.jackson.jsr310)

testAnnotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)

Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ gsonFire = "1.8.5"
hibernateValidator = "8.0.1.Final"
hidetakeSwagger = "2.19.2"
hikari = "5.0.1"
jackson = "2.17.1"
jakartaAnnotation = "1.3.5"
jakartaEl = "4.0.2"
jakartaJson = "2.0.1"
Expand Down Expand Up @@ -177,6 +178,7 @@ gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
gsonFire = { module = "io.gsonfire:gson-fire", version.ref = "gsonFire" }
hibernate-validation = { module = "org.hibernate.validator:hibernate-validator", version.ref = "hibernateValidator" }
hikari = { module = "com.zaxxer:HikariCP", version.ref = "hikari" }
jackson-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" }
jakarta-annotationApi = { module = "jakarta.annotation:jakarta.annotation-api", version.ref = "jakartaAnnotation" }
jakarta-el = { module = "org.glassfish:jakarta.el", version.ref = "jakartaEl" }
jakarta-json = { module = "org.glassfish:jakarta.json", version.ref = "jakartaJson" }
Expand Down

0 comments on commit f518fb0

Please sign in to comment.