Tag Archives: Unit Testing

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, […]

Unit Testing Servlets with Mockito

A quick example how to write unit tests for servlets Okay, I’m writing a Servlet. So I want to write a unit test too. With Mockito this is a quite simple task. Here I show you a simple unit test for a Hello World Servlet. The Servlet returns only „Hello World“. Mockito offers various annotations. For […]

Test JSON with a few lines of code

JSONassert helps you writing JSON unit tests You have to write a unit test and JSON is involved. Usually this will end up in a lot of lines of code. You know the situation, I bet. Here JSONassert comes into play. It allows to write JSON unit tests with just a few lines of code. For example checking an […]

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