globe with meridians Language: Deutsch · English

open book Unit tests with TestNG or JUnit and Spring support

Unit tests in Nuclos – JUnit and TestNG with a Spring context, ReflectionTestUtils, Mockito and @Autowired.

REFERENZ DEVELOPER UPDATED: JUL 2026 APPLIES TO NUCLOS 4.2026.X

On this page

Nuclos supports classic unit tests. A unit test checks a single method/class independently of the rest of the code – ideal for calculations. In the build and CI process all tests run automatically.

Frameworks

  • JUnit – the best-known framework, supported by Nuclos.
  • TestNG – also supported (its own Eclipse plugin, testng.xml suites).

Spring support

Nuclos tests can use Spring to inject beans and load the context:

ApproachDescription
SpringJUnit4ClassRunnerJUnit test with a Spring context.
AbstractTestNGSpringContextTestsTestNG test with a Spring context.
ReflectionTestUtilssets private fields for tests.
@Autowired / @Configurableinjection into test or domain objects.
Mockito / Springockitomocking dependencies in combination with Spring.

Examples

The most extensive examples are in the FDM project (Nuclos staff only). This page gives everyone else an overview of what is possible.

Related pages

gear Code coverage (JaCoCo)


Coverage.

Open →

gear Sonar code analysis


Sonar.

Open →

  • Keine Stichwörter