Search in sources :

Example 1 with SystemResolver

use of org.apache.synapse.commons.resolvers.SystemResolver in project wso2-synapse by wso2.

the class ResolverFactoryTest method testSystemResolver.

public void testSystemResolver() {
    String synapseVariable = "$SYSTEM:VAR";
    String envValue = "https://localhost:8080/service";
    Resolver resolver = ResolverFactory.getInstance().getResolver(synapseVariable);
    assertNotNull(resolver);
    assertTrue(resolver instanceof SystemResolver);
    EnvironmentVariables environmentVariables = new EnvironmentVariables();
    environmentVariables.set("VAR", envValue);
    assertEquals(envValue, resolver.resolve());
}
Also used : EnvironmentVariables(org.junit.contrib.java.lang.system.EnvironmentVariables) DefaultResolver(org.apache.synapse.commons.resolvers.DefaultResolver) SystemResolver(org.apache.synapse.commons.resolvers.SystemResolver) Resolver(org.apache.synapse.commons.resolvers.Resolver) SystemResolver(org.apache.synapse.commons.resolvers.SystemResolver)

Example 2 with SystemResolver

use of org.apache.synapse.commons.resolvers.SystemResolver in project wso2-synapse by wso2.

the class ResolverFactoryTest method testGetSystemResolver.

public void testGetSystemResolver() {
    String synapseVariable = "$SYSTEM:VAR";
    Resolver resolver = ResolverFactory.getInstance().getResolver(synapseVariable);
    assertNotNull(resolver);
    assertTrue(resolver instanceof SystemResolver);
}
Also used : DefaultResolver(org.apache.synapse.commons.resolvers.DefaultResolver) SystemResolver(org.apache.synapse.commons.resolvers.SystemResolver) Resolver(org.apache.synapse.commons.resolvers.Resolver) SystemResolver(org.apache.synapse.commons.resolvers.SystemResolver)

Aggregations

DefaultResolver (org.apache.synapse.commons.resolvers.DefaultResolver)2 Resolver (org.apache.synapse.commons.resolvers.Resolver)2 SystemResolver (org.apache.synapse.commons.resolvers.SystemResolver)2 EnvironmentVariables (org.junit.contrib.java.lang.system.EnvironmentVariables)1