49 lines
1.1 KiB
Java
49 lines
1.1 KiB
Java
package org.gcube.spatial.data.clients;
|
|
|
|
import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
|
|
import org.gcube.spatial.data.clients.model.engine.Engine;
|
|
import org.gcube.spatial.data.sdi.model.faults.RemoteException;
|
|
import org.junit.BeforeClass;
|
|
import org.junit.Test;
|
|
|
|
public class Tests {
|
|
|
|
|
|
|
|
|
|
// static String sdiHostname="sdi-t.pre.d4science.org";
|
|
// static String scope ="/pred4s/preprod/preVRE";
|
|
//
|
|
static String basePath="";
|
|
static String scope = "/gcube/devsec/devVRE";
|
|
|
|
|
|
static ConnectionDescriptor DEV_SDI=new ConnectionDescriptor("https://sdi.d4science.org/sdi-service/gcube/service/");
|
|
|
|
static ConnectionDescriptor DEV_GS=new ConnectionDescriptor("https://geoserver1.dev.d4science.org/geoserver/rest");
|
|
|
|
@BeforeClass
|
|
public static void setScope(){
|
|
TokenSetter.set(scope);
|
|
}
|
|
|
|
@Test
|
|
public void testContext() throws RemoteException, Exception {
|
|
|
|
|
|
new TestClient(DEV_SDI).get("SDI");
|
|
|
|
}
|
|
|
|
@Test
|
|
public void testBasicAuth() throws RemoteException, Exception {
|
|
|
|
|
|
TestClient c=new TestClient(DEV_GS);
|
|
c.setHttpBasicAuth("admin", "GS-d3v-98751");
|
|
c.get("workspaces");
|
|
|
|
}
|
|
|
|
}
|