Load the default token from a property file. Skip the tests if the token is null.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@162451 82a268e6-3cf1-43bd-a215-b396298e98cf
master
Manuele Simi 6 years ago
parent 4a7df8b36d
commit 34dcfec6e6

@ -3,6 +3,9 @@ package org.gcube.resourcemanagement.manager.webapp.context;
import static org.junit.Assert.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;
import java.util.Properties;
import java.util.UUID;
import javax.ws.rs.client.Entity;
@ -19,6 +22,7 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.informationsystem.impl.entity.ContextImpl;
import org.gcube.informationsystem.impl.utils.ISMapper;
import org.gcube.informationsystem.model.entity.Context;
import org.gcube.informationsystem.resourceregistry.client.ScopedTest;
import org.gcube.resourcemanagement.manager.io.codeexceptions.CodeFinder;
import org.gcube.resourcemanagement.manager.io.codeexceptions.SerializableErrorCode;
import org.gcube.resourcemanagement.manager.io.rs.RMCreateContextCode;
@ -59,10 +63,24 @@ public class RMContextTest extends JerseyTest {
private final static String RR = "http://manuele-registry.dev.d4science.org/resource-registry";
public static final String DEFAULT_TEST_SCOPE ="71b9ef86-76ba-4346-b16e-9a1af203f6db-98187548";
public static String DEFAULT_TEST_SCOPE ="";
private static boolean skipTest = false;
static {
Properties properties = new Properties();
try (InputStream input = RMContextTest.class.getClassLoader().getResourceAsStream("token.properties")) {
// load the properties file
properties.load(input);
} catch (IOException e) {
skipTest = true;
//throw new RuntimeException(e);
}
DEFAULT_TEST_SCOPE = properties.getProperty("DEFAULT_SCOPE_TOKEN");
if (DEFAULT_TEST_SCOPE.isEmpty())
skipTest = true;
}
@BeforeClass
public static void beforeClass() throws Exception {

Loading…
Cancel
Save