Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to check that the prefix is correctly loaded from the external config #5250

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ship/src/test/resources/config/external.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ ship {
resource-types-to-ignore = [
"https://some.resource.type"
]
files {
location-prefix-to-strip = "file:///prefix/to/strip"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ch.epfl.bluebrain.nexus.ship.config

import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.LocalStackS3StorageClient
import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.operations.s3.LocalStackS3StorageClient.uploadFileToS3
import ch.epfl.bluebrain.nexus.delta.rdf.syntax.iriStringContextSyntax
import ch.epfl.bluebrain.nexus.delta.rdf.syntax.{iriStringContextSyntax, uriStringContextSyntax}
import ch.epfl.bluebrain.nexus.delta.sdk.Defaults
import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri
import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef}
Expand Down Expand Up @@ -38,8 +38,11 @@ class ShipConfigSuite extends NexusSuite with ShipConfigFixtures with LocalStack
val expectedBaseUri = BaseUri("https://bbp.epfl.ch", Label.unsafe("v1"))
for {
externalConfigPath <- loader.absolutePath("config/external.conf")
_ <- ShipConfig.load(Some(Path(externalConfigPath))).map(_.input.targetBaseUri).assertEquals(expectedBaseUri)
} yield ()
config <- ShipConfig.load(Some(Path(externalConfigPath)))
} yield {
assertEquals(config.input.files.locationPrefixToStrip, Some(uri"""file:///prefix/to/strip"""))
assertEquals(config.input.targetBaseUri, expectedBaseUri)
}
}

test("Should have correct project mapping") {
Expand Down