unit tests for HelloWorld_UsingAPI - #98
Open
ricardo-ramos-moura wants to merge 1 commit into
Open
Conversation
Author
|
@NachiketaVadera please review this PR. |
iamteamstar
suggested changes
Feb 26, 2026
iamteamstar
left a comment
There was a problem hiding this comment.
Test files must live under src/test/, not src/main/. This is a Maven/Gradle standard convention. Placing tests in main means they get bundled into production artifacts.
Correct path:
src/test/java/com/helloworld/HelloWorld_APITest.java
|
|
||
| @InjectMocks | ||
| private HelloWorld_API helloWorld_API; | ||
|
|
There was a problem hiding this comment.
@Injectmocks is used to inject mock dependencies into the class under test. If HelloWorld_API has no dependencies, this annotation adds no value — a plain new HelloWorld_API() is clearer and more explicit. If it does have dependencies, they should be declared with @mock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add unit test for HelloWorld_UsingAPI.