use of io.gravitee.am.model.VirtualHost in project gravitee-access-management by gravitee-io.
the class VirtualHostValidatorTest method validate_invalidEmptyHost.
@Test
public void validate_invalidEmptyHost() {
VirtualHost vhost = getValidVirtualHost();
vhost.setHost("");
Throwable throwable = virtualHostValidator.validate(vhost, emptyList()).blockingGet();
assertNotNull(throwable);
assertTrue(throwable instanceof InvalidVirtualHostException);
}
use of io.gravitee.am.model.VirtualHost in project gravitee-access-management by gravitee-io.
the class VirtualHostValidatorTest method validate_notStartingSlashPath.
@Test
public void validate_notStartingSlashPath() {
VirtualHost vhost = getValidVirtualHost();
vhost.setPath("test");
Throwable throwable = virtualHostValidator.validate(vhost, emptyList()).blockingGet();
// '/' should be automatically append.
assertNull(throwable);
}
use of io.gravitee.am.model.VirtualHost in project gravitee-access-management by gravitee-io.
the class VirtualHostValidatorTest method validate_invalidEmptyHostPort.
@Test
public void validate_invalidEmptyHostPort() {
VirtualHost vhost = getValidVirtualHost();
vhost.setHost("locahost:");
Throwable throwable = virtualHostValidator.validate(vhost, emptyList()).blockingGet();
assertNotNull(throwable);
assertTrue(throwable instanceof InvalidVirtualHostException);
}
use of io.gravitee.am.model.VirtualHost in project gravitee-access-management by gravitee-io.
the class VirtualHostValidatorTest method validate_hostSubDomainOfOneOfDomainConstraints.
@Test
public void validate_hostSubDomainOfOneOfDomainConstraints() {
VirtualHost vhost = getValidVirtualHost();
String domainConstraint = vhost.getHost();
vhost.setHost("level2.level1." + domainConstraint);
Throwable throwable = virtualHostValidator.validate(vhost, Arrays.asList("test.gravitee.io", "other.gravitee.io", domainConstraint)).blockingGet();
assertNull(throwable);
}
use of io.gravitee.am.model.VirtualHost in project gravitee-access-management by gravitee-io.
the class VirtualHostValidatorTest method getValidDomain.
private Domain getValidDomain() {
Domain domain = new Domain();
domain.setName("Domain Test");
domain.setPath("/test");
domain.setVhostMode(false);
ArrayList<VirtualHost> vhosts = new ArrayList<>();
VirtualHost vhost = new VirtualHost();
vhost.setHost("valid.host.gravitee.io");
vhost.setPath("/test");
vhosts.add(vhost);
domain.setVhosts(vhosts);
return domain;
}
Aggregations