Search in sources :

Example 16 with Property

use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.

the class PropertyTopologyBuilderTest method testBuildSuccessfulForProviderProperty.

@Test
public void testBuildSuccessfulForProviderProperty() {
    PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
    propertyTopologyBuilder.addProperty(new Property("topology.gateway.provider.authentication.ShiroProvider.enabled", "value"));
    Topology topology = propertyTopologyBuilder.build();
    assertThat(topology, notNullValue());
    assertThat(topology.getProviders().size(), is(1));
    assertThat(topology.getProviders().iterator().next().isEnabled(), is(false));
}
Also used : Topology(org.apache.knox.gateway.topology.Topology) Property(org.apache.knox.gateway.topology.builder.property.Property) Test(org.junit.Test)

Example 17 with Property

use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.

the class PropertyTopologyBuilderTest method testBuildFailedForEmptyProviderParamValue.

@Test(expected = IllegalArgumentException.class)
public void testBuildFailedForEmptyProviderParamValue() {
    PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
    propertyTopologyBuilder.addProperty(new Property("topology.gateway.provider.authentication.ShiroProvider.param.name1", ""));
    propertyTopologyBuilder.build();
}
Also used : Property(org.apache.knox.gateway.topology.builder.property.Property) Test(org.junit.Test)

Example 18 with Property

use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.

the class PropertyTopologyBuilderTest method testBuildFailedForWrongProviderToken3.

@Test(expected = IllegalArgumentException.class)
public void testBuildFailedForWrongProviderToken3() {
    PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
    propertyTopologyBuilder.addProperty(new Property("topology.gateway.provider.authentication.ShiroProvider", "value"));
    propertyTopologyBuilder.build();
}
Also used : Property(org.apache.knox.gateway.topology.builder.property.Property) Test(org.junit.Test)

Aggregations

Property (org.apache.knox.gateway.topology.builder.property.Property)18 Test (org.junit.Test)17 Topology (org.apache.knox.gateway.topology.Topology)4 InterpretException (org.apache.knox.gateway.topology.builder.property.interpreter.InterpretException)1 PropertyInterpreter (org.apache.knox.gateway.topology.builder.property.interpreter.PropertyInterpreter)1