Skip to content

Commit

Permalink
DT-716
Browse files Browse the repository at this point in the history
  • Loading branch information
preetamnpr committed Dec 5, 2023
1 parent 393d028 commit 1cf7aaa
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ private void supplyScenarioParameters(JsonNode actionPrompt) {
new CarrierScenarioParameters(
"Carrier Service %d".formatted(RANDOM.nextInt(999999)),
generateSchemaValidVesselIMONumber(),
"service name",null,null,null,null);
"service name",
"%07d".formatted(RANDOM.nextInt(999999)),
"Commodity Type",
generateRandomString(5),
generateRandomString(5));
asyncOrchestratorPostPartyInput(
OBJECT_MAPPER
.createObjectNode()
Expand All @@ -130,6 +134,17 @@ private void supplyScenarioParameters(JsonNode actionPrompt) {
}


private String generateRandomString(int stringLength) {
int leftLimit = 97; // letter 'a'
int rightLimit = 122; // letter 'z'
Random random = new Random();

return random.ints(leftLimit, rightLimit + 1)
.limit(stringLength)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
.toString();
}

private void processBookingAmendment(JsonNode actionPrompt) {
log.info("Carrier.processBookingAmendment(%s)".formatted(actionPrompt.toPrettyString()));

Expand Down

0 comments on commit 1cf7aaa

Please sign in to comment.