mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Merge pull request #8117 from atmire/w2p-85525_pr-fix-qdccrosswalk-test
Refactor QDCCrosswalkTest to avoid config errors
This commit is contained in:
@@ -129,7 +129,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
||||
|
||||
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
|
||||
|
||||
protected static final ConfigurationService configurationService
|
||||
protected final ConfigurationService configurationService
|
||||
= DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
private final CrosswalkMetadataValidator metadataValidator = new CrosswalkMetadataValidator();
|
||||
@@ -141,9 +141,17 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
||||
private static String aliases[] = null;
|
||||
|
||||
static {
|
||||
initStatic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method again in tests to repeat initialization if necessary.
|
||||
*/
|
||||
public static void initStatic() {
|
||||
List<String> aliasList = new ArrayList<>();
|
||||
String propname = CONFIG_PREFIX + ".properties.";
|
||||
List<String> configKeys = configurationService.getPropertyKeys(propname);
|
||||
List<String> configKeys =
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyKeys(propname);
|
||||
for (String key : configKeys) {
|
||||
aliasList.add(key.substring(propname.length()));
|
||||
}
|
||||
|
@@ -76,6 +76,8 @@ public class QDCCrosswalkTest
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
// make sure that the config properties set in @BeforeClass are picked up
|
||||
QDCCrosswalk.initStatic();
|
||||
}
|
||||
|
||||
@After
|
||||
|
Reference in New Issue
Block a user