Skip to content

Commit

Permalink
chore: refactor and allow empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosentino11 committed Aug 22, 2024
1 parent 8947375 commit 4a67f70
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@ public CreateLocalDeploymentResponse handleRequest(CreateLocalDeploymentRequest
}
}

if (request.getGroupName().contains(":")) {
throw new InvalidArgumentsError("Thing group name cannot contain colon characters");
}
validateThingGroupName(request);

String deploymentId = UUID.randomUUID().toString();
LocalOverrideRequest localOverrideRequest = LocalOverrideRequest.builder().requestId(deploymentId)
Expand Down Expand Up @@ -541,6 +539,11 @@ public CreateLocalDeploymentResponse handleRequest(CreateLocalDeploymentRequest
});
}

private void validateThingGroupName(CreateLocalDeploymentRequest request) {
if (!Utils.isEmpty(request.getGroupName()) && request.getGroupName().contains(":")) {
throw new InvalidArgumentsError("Thing group name cannot contain colon characters");
}
}

@Override
public void handleStreamEvent(EventStreamJsonMessage streamRequestEvent) {
Expand Down

0 comments on commit 4a67f70

Please sign in to comment.