Fixing tests

This commit is contained in:
Luca Frosini 2020-02-05 16:16:38 +01:00
parent c4e47f7430
commit ee6da1b057
2 changed files with 24 additions and 0 deletions

View File

@ -37,6 +37,10 @@ public class ContextTest {
public static final String DEFAULT_TEST_SCOPE_ANOTHER_USER;
protected static final String REGISTRY_PROPERTIES_FILENAME = "registry.properties";
public static final String RESOURCE_REGISTRY_URL_PROPERTY = "RESOURCE_REGISTRY_URL";
public static final String RESOURCE_REGISTRY_URL;
static {
properties = new Properties();
InputStream input = ContextTest.class.getClassLoader().getResourceAsStream(PROPERTIES_FILENAME);
@ -64,6 +68,22 @@ public class ContextTest {
} catch(Exception e) {
throw new RuntimeException(e);
}
Properties registryProperties = new Properties();
input = ContextTest.class.getClassLoader().getResourceAsStream(REGISTRY_PROPERTIES_FILENAME);
try {
// load the properties file
registryProperties.load(input);
} catch (IOException e) {
throw new RuntimeException(e);
}
RESOURCE_REGISTRY_URL = registryProperties.getProperty(RESOURCE_REGISTRY_URL_PROPERTY);
if(RESOURCE_REGISTRY_URL!=null){
ResourceRegistryClientFactory.forceToURL(RESOURCE_REGISTRY_URL);
}
}
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {

View File

@ -2,3 +2,7 @@
/devsec.gcubekey
/gcube.gcubekey
/token.properties
/registry.properties
/registry.properties.empty
/registry.properties.redirect-test
/registry.properties.test