refs #2112: Port SmartExecutor to be compliant with new Authorization

https://support.d4science.org/issues/2112

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor-client@124007 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-02-09 16:21:07 +00:00
parent ed8e34325d
commit 1c63b51b8f
4 changed files with 38 additions and 6 deletions

View File

@ -17,6 +17,7 @@ import org.gcube.vremanagement.executor.client.proxies.SmartExecutorProxy;
import org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException;
import org.gcube.vremanagement.executor.exception.PluginNotFoundException;
import org.gcube.vremanagement.executor.plugin.PluginState;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -34,12 +35,17 @@ public class DefaultExecutorTest {
private SmartExecutorProxy proxy;
@Before
public void init(){
SecurityTokenProvider.instance.set("82a84741-debe-4c90-a907-c429c8272071");
public void bfore(){
SecurityTokenProvider.instance.set(TestUtility.TOKEN);
proxy = ExecutorPlugin.getExecutorProxy().build();
Assert.assertNotNull(proxy);
}
@After
public void after(){
SecurityTokenProvider.instance.reset();
}
@Test
public void launch() {
Map<String, Object> inputs = new HashMap<String, Object>();

View File

@ -21,6 +21,7 @@ import org.gcube.vremanagement.executor.client.plugins.query.filter.RandomEndpoi
import org.gcube.vremanagement.executor.client.plugins.query.filter.SpecificEndpointDiscoveryFilter;
import org.gcube.vremanagement.executor.client.proxies.SmartExecutorProxy;
import org.gcube.vremanagement.executor.client.util.Tuple;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@ -36,8 +37,13 @@ public class QueriedClientTest {
private static Logger logger = LoggerFactory.getLogger(QueriedClientTest.class);
@Before
public void before() throws Exception{
SecurityTokenProvider.instance.set("82a84741-debe-4c90-a907-c429c8272071");
public void bfore(){
SecurityTokenProvider.instance.set(TestUtility.TOKEN);
}
@After
public void after(){
SecurityTokenProvider.instance.reset();
}
private void launchTest(SmartExecutorProxy proxy) throws Exception {

View File

@ -10,6 +10,7 @@ import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.vremanagement.executor.client.plugins.ExecutorPlugin;
import org.gcube.vremanagement.executor.client.plugins.query.SmartExecutorPluginQuery;
import org.gcube.vremanagement.executor.client.plugins.query.filter.ListEndpointDiscoveryFilter;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
@ -24,8 +25,13 @@ public class SmartGenericWorkerDiscoveryQuery {
private static Logger logger = LoggerFactory.getLogger(SmartGenericWorkerDiscoveryQuery.class);
@Before
public void before() throws Exception{
SecurityTokenProvider.instance.set("82a84741-debe-4c90-a907-c429c8272071");
public void bfore(){
SecurityTokenProvider.instance.set(TestUtility.TOKEN);
}
@After
public void after(){
SecurityTokenProvider.instance.reset();
}
@Test

View File

@ -0,0 +1,14 @@
/**
*
*/
package org.gcube.vremanagement.executor.client;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class TestUtility {
public static final String TOKEN = "";
}