-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove TestObjectFactory and fix pom.xml
See "Singleton and unit testing" https://stackoverflow.com/questions/8256989/singleton-and-unit-testing > With singletons – the bad thing is that the getInstance() method is globally accessible. That means that you usually call it from within a class, instead of depending on an interface you can later mock. That's why it's impossible to replace it when you want to test your SUT. The solution is not to use the sneaky public static MySingleton getInstance() method, but to depend on an interface your class needs to work with. Do that, and you can pass in test doubles whenever you need to.
- Loading branch information
RalfBarkow
committed
May 16, 2024
1 parent
8b72fcd
commit 0c56f4c
Showing
4 changed files
with
0 additions
and
167 deletions.
There are no files selected for viewing
This file contains 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
28 changes: 0 additions & 28 deletions
28
src/test/java/de/danielluedecke/zettelkasten/SampleLoadTest.java
This file was deleted.
Oops, something went wrong.
87 changes: 0 additions & 87 deletions
87
src/test/java/de/danielluedecke/zettelkasten/TestObjectFactory.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.