use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.
the class PropertyTopologyBuilderTest method testBuildFailedForWrongProviderParamToken1.
@Test(expected = IllegalArgumentException.class)
public void testBuildFailedForWrongProviderParamToken1() {
PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
propertyTopologyBuilder.addProperty(new Property("topology.gateway.provider.authentication.ShiroProvider.param", "value"));
propertyTopologyBuilder.build();
}
use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.
the class PropertyTopologyBuilder method build.
public Topology build() {
Topology topology = new Topology();
PropertyInterpreter propertyInterpreter = new PropertyInterpreter(topology);
for (Property property : properties) {
try {
propertyInterpreter.interpret(property.getName(), property.getValue());
} catch (InterpretException ie) {
log.failedToInterpretProperty(property.getName(), ie);
throw new IllegalArgumentException(gatewayResources.wrongTopologyDataFormatError());
}
}
return topology;
}
use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.
the class PropertyTopologyBuilderTest method testBuildFailedForWrongServiceToken3.
@Test(expected = IllegalArgumentException.class)
public void testBuildFailedForWrongServiceToken3() {
PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
propertyTopologyBuilder.addProperty(new Property("topology.gateway.service.WEBHDFS.", "value"));
propertyTopologyBuilder.build();
}
use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.
the class PropertyTopologyBuilderTest method testBuildSuccessfulForServiceProperty.
@Test(expected = IllegalArgumentException.class)
public void testBuildSuccessfulForServiceProperty() {
PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
propertyTopologyBuilder.addProperty(new Property("topology.gateway.service.WEBHDFS..url", "http://host:50070/webhdfs"));
Topology topology = propertyTopologyBuilder.build();
assertThat(topology, notNullValue());
}
use of org.apache.knox.gateway.topology.builder.property.Property in project knox by apache.
the class PropertyTopologyBuilderTest method testBuildFailedForWrongServiceToken2.
@Test(expected = IllegalArgumentException.class)
public void testBuildFailedForWrongServiceToken2() {
PropertyTopologyBuilder propertyTopologyBuilder = new PropertyTopologyBuilder();
propertyTopologyBuilder.addProperty(new Property("topology.gateway.service.WEBHDFS", "value"));
propertyTopologyBuilder.build();
}
Aggregations