-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Add unit test for StandardMetadataServiceURLBuilder #8913
Add unit test for StandardMetadataServiceURLBuilder #8913
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.0 #8913 +/- ##
============================================
- Coverage 63.75% 63.39% -0.37%
+ Complexity 315 314 -1
============================================
Files 1169 1180 +11
Lines 49226 50061 +835
Branches 7361 7502 +141
============================================
+ Hits 31384 31736 +352
- Misses 14418 14856 +438
- Partials 3424 3469 +45
Continue to review full report at Codecov.
|
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.
All in all it looks good to me. I would suggest to write your test with Hamcrest. This will make the tests easier to read.
I suggest this since Hamcrest is already used in few tests in this project and already in the projects dependencies.
public void testBuild() { | ||
// test generateUrlWithoutMetadata | ||
List<URL> urls = builder.build(new DefaultServiceInstance("test", "127.0.0.1", 8080, ApplicationModel.defaultModel())); | ||
assertEquals(1, urls.size()); |
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.
You could use Hamcrest here to test the size in a more fluent
way.
For example here you can write: assertThat(urls, hasSize(1));
In general this is not really necessary but since Hamcrest is in the project dependencies it would be nice to use it to make Testing more pleasing for the eye (easier reading and writing)
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.
LGTM.
What is the purpose of the change
Add unit test for StandardMetadataServiceURLBuilder