@Test
public void testDefaultVariables() {
globalVariables.getVariables().put("defaultVar", "123");
TestCase testcase = new TestCase();
testcase.setName("MyTestCase");
testcase.setVariableDefinitions(Collections.singletonMap("test1Var", "456"));
TestContext testContext = createTestContext();
testcase.execute(testContext);
Assert.assertEquals(testContext.getVariables().get(CitrusConstants.TEST_NAME_VARIABLE), "MyTestCase");
Assert.assertEquals(testContext.getVariables().get(CitrusConstants.TEST_PACKAGE_VARIABLE), TestCase.class.getPackage().getName());
Assert.assertTrue(testContext.getVariables().containsKey("defaultVar"));
Assert.assertEquals(testContext.getVariables().get("defaultVar"), "123");
Assert.assertTrue(testContext.getVariables().containsKey("test1Var"));
Assert.assertEquals(testContext.getVariables().get("test1Var"), "456");
TestCase testcase2 = new TestCase();
testcase2.setName("MyTestCase2");
testcase2.setPackageName("com.consol.citrus");
testcase2.setVariableDefinitions(Collections.singletonMap("test2Var", "456"));
testContext = createTestContext();
testcase2.execute(testContext);
Assert.assertEquals(testContext.getVariables().get(CitrusConstants.TEST_NAME_VARIABLE), "MyTestCase2");
Assert.assertEquals(testContext.getVariables().get(CitrusConstants.TEST_PACKAGE_VARIABLE), "com.consol.citrus");
Assert.assertTrue(testContext.getVariables().containsKey("defaultVar"));
Assert.assertEquals(testContext.getVariables().get("defaultVar"), "123");