use of io.fabric8.service.jclouds.firewall.Rule in project fabric8 by jboss-fuse.
the class JsonRuleBaseReaderTest method parseWithGlobalDomainPath.
@Test
public void parseWithGlobalDomainPath() throws Exception {
final InputStream in = JsonRuleBaseBuilder.newRuleBase().globalCookieDomain(".global.com").rule("/foo/{path}", "https://foo.com/cheese/{path}").rule("/foo2/{path}", "https://foo2.com/cheese/{path}", null, "overriddenDomain").inputStream();
final Map<String, HttpProxyRule> rules = JsonRuleBaseReader.parseJson(in);
assertThat(rules.get("/foo/{path}").getCookieDomain(), equalTo(".global.com"));
assertThat(rules.get("/foo2/{path}").getCookieDomain(), equalTo("overriddenDomain"));
}
use of io.fabric8.service.jclouds.firewall.Rule in project fabric8 by jboss-fuse.
the class JsonRuleBaseReaderTest method parseWithCookiePathAndCookieDomain.
@Test
public void parseWithCookiePathAndCookieDomain() throws Exception {
final InputStream in = JsonRuleBaseBuilder.newRuleBase().rule("/foo/{path}", "https://foo.com/cheese/{path}", "/cookiePath", ".domain.com").inputStream();
final Map<String, HttpProxyRule> rules = JsonRuleBaseReader.parseJson(in);
final HttpProxyRule httpProxyRule = rules.get("/foo/{path}");
assertThat(httpProxyRule.getCookiePath(), equalTo("/cookiePath"));
assertThat(httpProxyRule.getCookieDomain(), equalTo(".domain.com"));
}
use of io.fabric8.service.jclouds.firewall.Rule in project fabric8 by jboss-fuse.
the class MappingConfigurationTest method assertMapping.
protected void assertMapping(String path, String service) {
Map<String, MappedServices> mappingRules = httpGateway.getMappedServices();
assertTrue("Should have some mapping rules", mappingRules.size() > 0);
MappedServices mappedServices = mappingRules.get(path);
assertNotNull("Could not find mapping rule for path " + path, mappedServices);
Collection<String> serviceUrls = mappedServices.getServiceUrls();
assertTrue("Could not find service " + service + " in services " + serviceUrls, serviceUrls.contains(service));
}
Aggregations