Skip to content

Commit

Permalink
remove TestObjectFactory and fix pom.xml
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 167 deletions.
36 changes: 0 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m</argLine>
<properties>
<property>
<name>junit</name>
<value>false</value>
</property>
</properties>
<threadCount>1</threadCount>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>3.2.5</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
Expand Down Expand Up @@ -248,18 +224,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.github.caciocavallosilano</groupId>
<artifactId>cacio-tta</artifactId>
<version>1.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
28 changes: 0 additions & 28 deletions src/test/java/de/danielluedecke/zettelkasten/SampleLoadTest.java

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions src/test/java/playground/MainFrameTest.java

This file was deleted.

0 comments on commit 0c56f4c

Please sign in to comment.