Skip tests that require a connection to Resource Registry when the token is not set.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@161893 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
57d6749dea
commit
4dccab1032
|
@ -46,6 +46,9 @@ public class RMContextTest extends JerseyTest {
|
|||
|
||||
private final static String RR = "";
|
||||
|
||||
private static boolean skipTest = false;
|
||||
|
||||
|
||||
public static final String DEFAULT_TEST_SCOPE ="";
|
||||
|
||||
@BeforeClass
|
||||
|
@ -54,6 +57,10 @@ public class RMContextTest extends JerseyTest {
|
|||
}
|
||||
|
||||
public static void setContext(String token) throws ObjectNotFound, Exception{
|
||||
if (DEFAULT_TEST_SCOPE.isEmpty()) {
|
||||
skipTest = true;
|
||||
return;
|
||||
}
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
ScopeProvider.instance.set(getCurrentScope(token));
|
||||
}
|
||||
|
@ -98,6 +105,7 @@ public class RMContextTest extends JerseyTest {
|
|||
*/
|
||||
@Test
|
||||
public void step1_Create() {
|
||||
if (skipTest) return;
|
||||
Context newContext = new ContextImpl(contextName);
|
||||
try {
|
||||
System.out.print(ISMapper.marshal(newContext));
|
||||
|
@ -122,6 +130,7 @@ public class RMContextTest extends JerseyTest {
|
|||
*/
|
||||
@Test
|
||||
public void step1_CreateWithInvalidParent() {
|
||||
if (skipTest) return;
|
||||
Context newContext = new ContextImpl(contextName);
|
||||
newContext.setParent(new ContextImpl("DoNotExist"));
|
||||
try {
|
||||
|
|
Reference in New Issue