Tag Archives: JUnit

Test your code not throwing any exception

with JUnit and Assertj Recently I had to test that the code does not throw any exception. We all know that AssertJ gives us a powerful set of assertions which improves your test code readability. And again, AssertJ helped me to do the job with assertThatCode: You can find more assertions example on github. I […]

Workaround – No tests found with Testrunner JUnit 5

Java 8, Eclipse, JUnit 5 & Gradle It seems to be a bug in Eclipse and it’is fixed in the Oxgen Release 3 (4.7.3). But I still have the problem in my Java 8 project. So I did a little trick. I changed the version for the engine and the launcher back to 5.1.0. Now, […]

Spring und Unit-Tests mit Mockito

Ich hatte mich schon längere Zeit gefragt, ob ich nicht noch einfacher auf die Mocks zugreifen kann, um das Verhalten zu manipulieren. Also recherierte ich ein bißchen und bin dann bei der neusten Mockito-Version (1.9.5) auf die Annotations @Mock und @InjectMocks aufmerksam gewurden. Mit @Mock kennzeichne ich einfach die Klassen die zu Mocken sind. Und […]

Consent Management Platform von Real Cookie Banner