-
Notifications
You must be signed in to change notification settings - Fork 68
Improve topic validation #351
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
Improve topic validation #351
Conversation
* Check if topic exists already for both partitioned and unpartitioned cases prior to creating. Fixes spring-projects#266
if (topic.isPartitioned()) { | ||
List<String> matchingPartitions = getMatchingTopicPartitions(topic, existingTopicsInNamespace); | ||
if (existingTopicsInNamespace.contains(topicName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sobychacko sorry, I just realized that I muddied the code change commit w/ "use var everywhere" commit. I think the change is small enough to decipher though. 2 parts, w/ this being the 1st part of the actual change.
This is part one of the change: "If there is already a non-partitioned topic out there - barf"
} | ||
} | ||
} | ||
else { | ||
if (!existingTopicsInNamespace.contains(topic.getFullyQualifiedTopicName())) { | ||
this.logger.debug(() -> "Topic " + topic.getFullyQualifiedTopicName() + " does not exist."); | ||
var matchingPartitions = getMatchingTopicPartitions(topic, existingTopicsInNamespace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part two of the change: "If there is already a partitioned topic out there - barf"
@@ -52,6 +52,7 @@ | |||
*/ | |||
@ExtendWith(SpringExtension.class) | |||
@ContextConfiguration | |||
@SuppressWarnings("JUnitMalformedDeclaration") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prevents the warnings from IDEA on commit saying that test methods should declare method parameters (which IS valid w/ junit5).
Fixes #266