| Auszug |
|---|
|
Nuclos unit test: JUnit, TestNG, Spring, SpringJUnit4ClassRunner, AbstractTestNGSpringContextTests, Mockito, @Autowired, ReflectionTestUtils. |
Language: Deutsch · English
Unit tests with TestNG or JUnit and Spring support
Unit tests in Nuclos – JUnit and TestNG with a Spring context, ReflectionTestUtils, Mockito and @Autowired.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
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:
| Approach | Description |
|---|
SpringJUnit4ClassRunner | JUnit test with a Spring context. |
AbstractTestNGSpringContextTests | TestNG test with a Spring context. |
ReflectionTestUtils | sets private fields for tests. |
@Autowired / @Configurable | injection into test or domain objects. |
| Mockito / Springockito | mocking dependencies in combination with Spring. |
| Info |
|---|
|
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
Code coverage (JaCoCo)
Coverage.
Open →
Sonar code analysis
Sonar.
Open →