Unverified Commit 57244dd3 authored by Rafa Hernandez's avatar Rafa Hernandez
Browse files

test(initsession): config with enviroment vars

parent 83af4c57
......@@ -36,4 +36,5 @@ node_modules/
.externalNativeBuild
GLPIProject.iml
app/
/gradle.properties
gradle.properties
\ No newline at end of file
......@@ -9,7 +9,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
import static org.junit.Assert.assertNotEquals;
/**
* Instrumented test, which will execute on an Android device.
......@@ -20,15 +20,14 @@ import static org.junit.Assert.*;
public class GLPITest {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
String sessionToken = "";
@Test
public void initSessionTest() throws Exception {
GLPI glpi = new GLPI(appContext, "https://dev.flyve.org/glpi/apirest.php/");
glpi.initSessionByCredentials("rafaelje@gmail.com", "12345678", new GLPI.InitSessionCallback() {
GLPI glpi = new GLPI(appContext, BuildConfig.GLPI_URL);
glpi.initSessionByCredentials(BuildConfig.GLPI_USER, BuildConfig.GLPI_PASSWORD, new GLPI.InitSessionCallback() {
@Override
public void onResponse(InitSession response) {
sessionToken = response.getSessionToken();
String sessionToken = response.getSessionToken();
assertNotEquals("", sessionToken);
}
......@@ -38,7 +37,4 @@ public class GLPITest {
}
});
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment