Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/hub 1565 #1413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Feature/hub 1565 #1413

wants to merge 2 commits into from

Conversation

harinadh-dasari
Copy link
Contributor

No description provided.

@allustag allustag self-requested a review October 16, 2024 12:43
@@ -131,6 +131,11 @@ public Response createChannel(@PathParam("channel") String channelName, String j
log.trace("put channel {} {}", channelName, json);
Optional<ChannelConfig> oldConfig = channelService.getChannelConfig(channelName, false);
ChannelConfig channelConfig = ChannelConfig.createFromJsonWithName(json, channelName);
if (channelConfig.getCreationDate()!= null) {
// If the creation date is being modified, throw a 500 error
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Haripriya99j As informed earlier, don't introduce new logic instead make use of existing logic. Also, this logic will unnecessarily return error message while creating with creationDate but that is not the requirement. Below is the class already available to perform validation and returns error message. See how we can use make use of it.
https://github.com/flightstats/hub/blob/feature/HUB-1565/src/main/java/com/flightstats/hub/channel/ChannelValidator.java
Write test cases as well to ensure it is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants