Skip to content

Commit

Permalink
Add a test to check that the prefix is correctly loaded from the exte…
Browse files Browse the repository at this point in the history
…rnal config (#5250)

Co-authored-by: Simon Dumas <[email protected]>
  • Loading branch information
imsdu and Simon Dumas authored Nov 26, 2024
1 parent 2d6f506 commit c5578ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit c5578ce

Please sign in to comment.