Search in sources :

Example 1 with DefaultTestCaseRunner

use of com.consol.citrus.DefaultTestCaseRunner in project yaks by citrusframework.

the class InjectEnvVarsHookTest method shouldInjectEnvVarsDefaultValues.

@Test
@SuppressWarnings("CucumberJavaStepDefClassIsPublic")
public void shouldInjectEnvVarsDefaultValues() {
    InjectEnvVarsHook hook = new InjectEnvVarsHook() {

        @Override
        protected Optional<String> getNamespaceSetting() {
            return Optional.of("foo");
        }

        @Override
        protected Optional<String> getClusterWildcardSetting() {
            return Optional.empty();
        }
    };
    TestContext context = TestContextFactory.newInstance().getObject();
    TestCaseRunner runner = new DefaultTestCaseRunner(context);
    CitrusAnnotations.injectTestRunner(hook, runner);
    hook.injectEnvVars(null);
    Assertions.assertThat(context.getVariable(YaksVariableNames.NAMESPACE.value())).isEqualTo("foo");
    Assertions.assertThat(context.getVariable(YaksVariableNames.CLUSTER_WILDCARD_DOMAIN.value())).isEqualTo("foo." + YaksSettings.DEFAULT_DOMAIN_SUFFIX);
}
Also used : DefaultTestCaseRunner(com.consol.citrus.DefaultTestCaseRunner) TestContext(com.consol.citrus.context.TestContext) DefaultTestCaseRunner(com.consol.citrus.DefaultTestCaseRunner) TestCaseRunner(com.consol.citrus.TestCaseRunner) Test(org.junit.Test)

Example 2 with DefaultTestCaseRunner

use of com.consol.citrus.DefaultTestCaseRunner in project yaks by citrusframework.

the class InjectEnvVarsHookTest method shouldInjectEnvVars.

@Test
@SuppressWarnings("CucumberJavaStepDefClassIsPublic")
public void shouldInjectEnvVars() {
    InjectEnvVarsHook hook = new InjectEnvVarsHook() {

        @Override
        protected Optional<String> getNamespaceSetting() {
            return Optional.of("foo");
        }

        @Override
        protected Optional<String> getClusterWildcardSetting() {
            return Optional.of("foo.cluster.io");
        }
    };
    TestContext context = TestContextFactory.newInstance().getObject();
    TestCaseRunner runner = new DefaultTestCaseRunner(context);
    CitrusAnnotations.injectTestRunner(hook, runner);
    hook.injectEnvVars(null);
    Assertions.assertThat(context.getVariable(YaksVariableNames.NAMESPACE.value())).isEqualTo("foo");
    Assertions.assertThat(context.getVariable(YaksVariableNames.CLUSTER_WILDCARD_DOMAIN.value())).isEqualTo("foo.cluster.io");
}
Also used : DefaultTestCaseRunner(com.consol.citrus.DefaultTestCaseRunner) TestContext(com.consol.citrus.context.TestContext) DefaultTestCaseRunner(com.consol.citrus.DefaultTestCaseRunner) TestCaseRunner(com.consol.citrus.TestCaseRunner) Test(org.junit.Test)

Example 3 with DefaultTestCaseRunner

use of com.consol.citrus.DefaultTestCaseRunner in project yaks by citrusframework.

the class SeleniumStepsTest method injectResources.

@Before
public void injectResources() {
    TestContext context = citrus.getCitrusContext().createTestContext();
    steps = new SeleniumSteps();
    runner = new DefaultTestCaseRunner(context);
    CitrusAnnotations.injectAll(steps, citrus, context);
    CitrusAnnotations.injectTestRunner(steps, runner);
    citrus.getCitrusContext().bind("seleniumBrowser", seleniumBrowser);
}
Also used : DefaultTestCaseRunner(com.consol.citrus.DefaultTestCaseRunner) TestContext(com.consol.citrus.context.TestContext) Before(org.junit.Before)

Aggregations

DefaultTestCaseRunner (com.consol.citrus.DefaultTestCaseRunner)3 TestContext (com.consol.citrus.context.TestContext)3 TestCaseRunner (com.consol.citrus.TestCaseRunner)2 Test (org.junit.Test)2 Before (org.junit.Before)1