use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotVariableServerConnector method testVariableUpdateExistingVariableWithToken.
@Test(groups = { "ut" })
public void testVariableUpdateExistingVariableWithToken() throws UnirestException {
configureMockedVariableServerConnection();
SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", "123");
TestVariable existingVariable = new TestVariable(12, "key", "value", false, TestVariable.TEST_VARIABLE_PREFIX + "key");
connector.upsertVariable(existingVariable, true);
verify(variablesRequest, never()).header("Authorization", "Token 123");
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotVariableServerConnector method testServerActiveAliveAndSecuredWithToken.
/**
* test connection is done if token provided
* @throws UnirestException
*/
@Test(groups = { "ut" })
public void testServerActiveAliveAndSecuredWithToken() throws UnirestException {
configureMockedVariableServerConnection();
SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", "123");
verify(getAliveRequest).header("Authorization", "Token 123");
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotVariableServerConnector method testCreateTestCaseWithoutToken.
/**
* Check tokens are not added to request when not provided
* @throws UnirestException
*/
@Test(groups = { "ut" })
public void testCreateTestCaseWithoutToken() throws UnirestException {
configureMockedVariableServerConnection();
SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
connector.createTestCase("foo");
verify(createTestCaseRequest, never()).header(eq("Authorization"), anyString());
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotVariableServerConnector method testFetchVariable.
@Test(groups = { "ut" })
public void testFetchVariable() throws UnirestException {
configureMockedVariableServerConnection();
SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
Map<String, TestVariable> variables = connector.getVariables();
Assert.assertEquals(variables.get("key1").getValue(), "value1");
Assert.assertEquals(variables.get("key2").getValue(), "value2");
}
use of com.seleniumtests.connectors.selenium.SeleniumRobotVariableServerConnector in project seleniumRobot by bhecquet.
the class TestSeleniumRobotVariableServerConnector method testCreateEnvironmentWithoutToken.
/**
* Check tokens are not added to request when not provided
* @throws UnirestException
*/
@Test(groups = { "ut" })
public void testCreateEnvironmentWithoutToken() throws UnirestException {
configureMockedVariableServerConnection();
SeleniumRobotVariableServerConnector connector = new SeleniumRobotVariableServerConnector(true, SERVER_URL, "Test1", null);
connector.createEnvironment();
verify(createEnvironmentRequest, never()).header(eq("Authorization"), anyString());
}
Aggregations