Identifier { public void validate() { if (id.equals("api")) { throwInvalidId(id, "'api' not allowed."); } } @JsonCreator  Identifier(String id); String toDns(); @Override String toString(); @JsonValue String id(); String capitalizedType(); void validate(); @Override boolean equals(Object o); @Override int hashCode(); static void throwInvalidId(String id, String explanation);  }
@Test(expected = IllegalArgumentException.class) public void new_tenant_id_cannot_contain_underscore() { TenantId.validate("underscore_tenant"); }
@Test(expected = IllegalArgumentException.class) public void new_tenant_id_cannot_contain_dot() { TenantId.validate("tenant.with.dots"); }
@Test(expected = IllegalArgumentException.class) public void new_tenant_id_cannot_contain_uppercase() { TenantId.validate("UppercaseTenant"); }
@Test(expected = IllegalArgumentException.class) public void new_tenant_id_cannot_start_with_dash() { TenantId.validate("-tenant"); }
@Test(expected = IllegalArgumentException.class) public void new_tenant_id_cannot_end_with_dash() { TenantId.validate("tenant-"); }
@Test(expected = IllegalArgumentException.class) public void new_application_id_cannot_contain_underscore() { ApplicationId.validate("underscore_application"); }
@Test(expected = IllegalArgumentException.class) public void new_application_id_cannot_contain_dot() { ApplicationId.validate("application.with.dots"); }
@Test(expected = IllegalArgumentException.class) public void new_application_id_cannot_contain_uppercase() { ApplicationId.validate("UppercaseApplication"); }
@Test(expected = IllegalArgumentException.class) public void new_application_id_cannot_start_with_dash() { ApplicationId.validate("-application"); }
@Test(expected = IllegalArgumentException.class) public void new_application_id_cannot_end_with_dash() { ApplicationId.validate("application-"); }