FINERACT-2421: Allow hyphens in query params of Batch API calls

This commit is contained in:
Adam Saghy
2026-01-30 11:37:58 +01:00
parent 5831cb3afd
commit 0fd0f977eb
2 changed files with 6 additions and 2 deletions
@@ -47,12 +47,12 @@ public class CommandStrategyProvider {
/**
* Regex pattern for specifying any number of query params or not specific any query param
*/
private static final String OPTIONAL_QUERY_PARAM_REGEX = "(\\?(\\w+=[^&]+)(?:&\\w+=[^&]+)*)?";
private static final String OPTIONAL_QUERY_PARAM_REGEX = "(\\?([\\w-]+=[^&]+)(?:&[\\w-]+=[^&]+)*)?";
/**
* Regex pattern for specifying query params
*/
private static final String MANDATORY_QUERY_PARAM_REGEX = "(\\?(\\w+=[^&]+)(?:&\\w+=[^&]+)*)";
private static final String MANDATORY_QUERY_PARAM_REGEX = "(\\?([\\w-]+=[^&]+)(?:&[\\w-]+=[^&]+)*)";
/**
* Regex pattern for specifying any query param that has key = 'command' or not specific anything.
@@ -225,6 +225,10 @@ public class CommandStrategyProviderTest {
Arguments.of(
"loans/external-id/0083477d-ea2a-45a4-a244-cb79a9ecf741/transactions/reage-preview?frequencyType=MONTHS&locale=en_US&frequencyNumber=1&dateFormat=MM%2Fdd%2Fyyyy&startDate=02%2F05%2F2026&numberOfInstallments=6",
HttpMethod.GET, "getReagePreviewByLoanExternalIdCommandStrategy",
mock(GetReagePreviewByLoanExternalIdCommandStrategy.class)),
Arguments.of(
"loans/external-id/8dfad438-2319-48ce-8520-10a62801e9a1/transactions/reage-preview?frequency-number=2&frequencyType=long-string",
HttpMethod.GET, "getReagePreviewByLoanExternalIdCommandStrategy",
mock(GetReagePreviewByLoanExternalIdCommandStrategy.class)));
}