Skip to content

Commit

Permalink
Update DNS Merchant regular expression length (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored Aug 29, 2024
1 parent e6f8d76 commit a98e2bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/checkout/EnvironmentSubdomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static URI addSubdomainToApiUrlEnvironment(IEnvironment environment, Str
} catch (final URISyntaxException e) {
throw new CheckoutException(e);
}
Pattern pattern = Pattern.compile("^[0-9a-z]{8,11}$");
Pattern pattern = Pattern.compile("^[0-9a-z]+$");
Matcher matcher = pattern.matcher(subdomain);
if (matcher.matches()) {
String host = apiUrl.getHost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void shouldCreateConfiguration() {
}

@ParameterizedTest
@ValueSource(strings = {"123dmain", "123domain", "1234domain", "12345domain"})
@ValueSource(strings = {"a", "ab", "abc", "abc1", "12345domain"})
void shouldCreateConfigurationWithSubdomain(String subdomain) {

final StaticKeysSdkCredentials credentials = Mockito.mock(StaticKeysSdkCredentials.class);
Expand All @@ -58,7 +58,7 @@ void shouldCreateConfigurationWithSubdomain(String subdomain) {
}

@ParameterizedTest
@ValueSource(strings = {"", "123", "123bad", "12345domainBad"})
@ValueSource(strings = {"", " ", " ", " - ", "a b", "ab c1"})
void shouldCreateConfigurationWithBadSubdomain(String subdomain) {

final StaticKeysSdkCredentials credentials = Mockito.mock(StaticKeysSdkCredentials.class);
Expand Down

0 comments on commit a98e2bb

Please sign in to comment.