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

14 topics handler #29

Merged
merged 19 commits into from
Feb 9, 2024
Merged

14 topics handler #29

merged 19 commits into from
Feb 9, 2024

Conversation

cybertobbe
Copy link
Contributor

Related Issue(s)

Closes #14

Proposed Changes

We have created a Topic and a TopicTest class. Also updated the pom.xml file with assertJ and Junit5.

  • Change 1: Added tests for exact and non-exact matches between Topic instances.
  • Change 2: Enhanced the Topic class to handle invalid topic names more effectively.
  • Change 3: Introduced tests for exception handling when creating topics with empty strings or names starting with a forward slash.

cybertobbe and others added 4 commits February 4, 2024 20:05
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Kathrine Altmann <kathrine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
…actory method createTopic().

Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
@cybertobbe cybertobbe added the enhancement New feature or request label Feb 5, 2024
@cybertobbe cybertobbe linked an issue Feb 5, 2024 that may be closed by this pull request
ByHatice
ByHatice previously approved these changes Feb 6, 2024
Copy link
Contributor

@Frlundsten Frlundsten left a comment

Choose a reason for hiding this comment

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

To be able to close #14 this class should handle wildcards matching. If not, then maby this could solve its own issue because we need the Topics class either way.

Topics can be an exact match like myhome/first_floor/kitchen/temperature but we can also use wildcards so myhome/first_floor/+/temperature is a valid topic name for subscribing to messages.

myhome/first_floor/kitchen/temperature
myhome/first_floor/livingroom/temperature

we want to subscribe to both with following:
myhome/first_floor/+/temperature

So we need to check that everything after first_floor that ends with temperature should be subscribed to.
I think that using regex might be a solution to this.
Or substrings

Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
cybertobbe and others added 2 commits February 6, 2024 11:46
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
pom.xml Outdated Show resolved Hide resolved
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Copy link
Contributor

@Frlundsten Frlundsten left a comment

Choose a reason for hiding this comment

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

Make name variable final and this will look good. Nice job with matchesWildcard method! 🥇

src/main/java/org/fungover/Topic.java Outdated Show resolved Hide resolved
src/main/java/org/fungover/Topic.java Outdated Show resolved Hide resolved
src/main/java/org/fungover/Topic.java Outdated Show resolved Hide resolved
src/main/java/org/fungover/Topic.java Outdated Show resolved Hide resolved
altmannk and others added 6 commits February 8, 2024 18:58
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
…dation

Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
…in TopicTest

Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
altmannk and others added 3 commits February 9, 2024 00:27
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Co-authored-by: Ingrid Hammargren <ingrid.hammargren@iths.se>
Co-authored-by: Tobias Sjöström <tobias.sjostrom@iths.se>
Co-authored-by: Katherine Altmann <katherine.altmann@iths.se>
Copy link

sonarcloud bot commented Feb 9, 2024

@marcusju23 marcusju23 added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit 561254d Feb 9, 2024
2 checks passed
@marcusju23 marcusju23 deleted the 14-topics-handler branch February 9, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Topics handler
9 participants