check-domain-setup-permission #97
@ -17,7 +17,10 @@ public class StringProperty<P extends StringProperty<P>> extends ValidatableProp
|
|||||||
|
|
||||||
protected static final String[] KEY_ORDER = Array.join(
|
protected static final String[] KEY_ORDER = Array.join(
|
||||||
ValidatableProperty.KEY_ORDER_HEAD,
|
ValidatableProperty.KEY_ORDER_HEAD,
|
||||||
Array.of("matchesRegEx", "notMatchesRegEx", "minLength", "maxLength", "provided"),
|
Array.of("matchesRegEx", "matchesRegExDescription",
|
||||||
|
"notMatchesRegEx", "notMatchesRegExDescription",
|
||||||
|
"minLength", "maxLength",
|
||||||
|
"provided"),
|
||||||
ValidatableProperty.KEY_ORDER_TAIL,
|
ValidatableProperty.KEY_ORDER_TAIL,
|
||||||
Array.of("undisclosed"));
|
Array.of("undisclosed"));
|
||||||
private String[] provided;
|
private String[] provided;
|
||||||
|
@ -101,17 +101,10 @@ class HsDomainSetupBookingItemValidatorUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
void containsAllValidations() {
|
void containsAllValidations() {
|
||||||
// when
|
// when
|
||||||
final var validator = HsBookingItemEntityValidatorRegistry.forType(CLOUD_SERVER);
|
final var validator = HsBookingItemEntityValidatorRegistry.forType(DOMAIN_SETUP);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertThat(validator.properties()).map(Map::toString).containsExactlyInAnyOrder(
|
assertThat(validator.properties()).map(Map::toString).containsExactlyInAnyOrder(
|
||||||
"{type=boolean, propertyName=active, defaultValue=true}",
|
"{type=string, propertyName=domainName, matchesRegEx=[^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,12}], matchesRegExDescription=is not a (non-top-level) fully qualified domain name, notMatchesRegEx=[(co|org|gov|ac|sch)\\.uk, (com|net|org|edu|gov|asn|id)\\.au, (co|ne|or|ac|go)\\.jp, (com|net|org|gov|edu|ac)\\.cn, (com|net|org|gov|edu|mil|art)\\.br, (co|net|org|gen|firm|ind)\\.in, (com|net|org|gob|edu)\\.mx, (gov|edu)\\.it, (co|net|org|govt|ac|school|geek|kiwi)\\.nz, (co|ne|or|go|re|pe)\\.kr], notMatchesRegExDescription=is a forbidden registrar-level domain name, required=true, writeOnce=true}");
|
||||||
"{type=integer, propertyName=CPU, min=1, max=32, required=true}",
|
|
||||||
"{type=integer, propertyName=RAM, unit=GB, min=1, max=8192, required=true}",
|
|
||||||
"{type=integer, propertyName=SSD, unit=GB, min=25, max=1000, step=25, requiresAtLeastOneOf=[SDD, HDD]}",
|
|
||||||
"{type=integer, propertyName=HDD, unit=GB, min=250, max=4000, step=250, requiresAtLeastOneOf=[SSD, HDD]}",
|
|
||||||
"{type=integer, propertyName=Traffic, unit=GB, min=250, max=10000, step=250, requiresAtMaxOneOf=[Bandwidth, Traffic]}",
|
|
||||||
"{type=integer, propertyName=Bandwidth, unit=GB, min=250, max=10000, step=250, requiresAtMaxOneOf=[Bandwidth, Traffic]}",
|
|
||||||
"{type=enumeration, propertyName=SLA-Infrastructure, values=[BASIC, EXT8H, EXT4H, EXT2H]}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1552,6 +1552,8 @@ public class ImportHostingAssets extends BaseOfficeDataImport {
|
|||||||
.caption("BI " + domainSetup.getIdentifier())
|
.caption("BI " + domainSetup.getIdentifier())
|
||||||
.project((HsBookingProjectRealEntity) relatedProject)
|
.project((HsBookingProjectRealEntity) relatedProject)
|
||||||
//.validity(toPostgresDateRange(created, cancelled))
|
//.validity(toPostgresDateRange(created, cancelled))
|
||||||
|
.resources(Map.ofEntries(
|
||||||
|
entry("domainName", domainSetup.getIdentifier())))
|
||||||
.build();
|
.build();
|
||||||
domainSetup.setBookingItem(bookingItem);
|
domainSetup.setBookingItem(bookingItem);
|
||||||
bookingItems.put(nextAvailableBookingItemId(), bookingItem);
|
bookingItems.put(nextAvailableBookingItemId(), bookingItem);
|
||||||
|
Loading…
Reference in New Issue
Block a user