Skip to content

Commit

Permalink
test(pid): add defaults for EZID via MPCONFIG
Browse files Browse the repository at this point in the history
Test execution in PersistentIdentifierServiceBeanTest requires to
construct an EZID provider. The providers constructor tries to login
with the service, which is not relevant for the test.

Providing EZID configuration settings via a
src/test/resource/META-INF/microprofile-config.properties file makes the
warnings go away about missing config options and also avoids sending
requests to the real service for every test execution.
  • Loading branch information
poikilotherm committed Jun 29, 2022
1 parent c541538 commit 4e41d25
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/resources/META-INF/microprofile-config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# DEFAULTS FOR TESTS
# Unlike src/main/resources/META-INF/microprofile-config.properties, this file will not be included in
# a packaged WAR. It can be used to provide sane defaults for things like unit tests on classes requiring
# some sort of configuration.

# PersistentIdentifierServiceBeanTest loads all the providers, which makes the EZID provider reach out
# to the service - switching to example.org to not trigger a DDoS via test executions at their place.
dataverse.pid.ezid.api-url=http://example.org
# Also requires the username and the password to be present when used in production, use a default for unit testing.
dataverse.pid.ezid.username=Dataverse Unit Test
dataverse.pid.ezid.password=supersecret

0 comments on commit 4e41d25

Please sign in to comment.