Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Jira
    serverONAP JIRA
    serverId425b2b0a-557c-3c0c-b515-579789cceedb
    keyCPS-95
  • Jira
    serverONAP JIRA
    serverId425b2b0a-557c-3c0c-b515-579789cceedb
    keyCPS-124
  •  
    Jira
    serverONAP JIRA
    serverId425b2b0a-557c-3c0c-b515-579789cceedb
    keyCPS-128

...

draw.io Diagram
borderfalse
diagramNameCPS DB Testing Unit vs Integration
simpleViewerfalse
width
linksauto
tbstyleinline
diagramDisplayName
lboxfalse
diagramWidth761
revision45

While using unit tests is a common approach for Java application testing, it seems insufficient  in a context of testing the
actual data persistence/retrieval functionality:

  • Test covers a small slice of functionality while the major piece served by external services (Spring data framework,
    JDBC driver and database itself) remain not used (not tested)
  • JPA repositories can be only used as mocks to test the service implementation; the effort to setup the expected behaviors
    for JPA repository mocks is comparable with (or exceeds) the effort required to setup the actual data for same cases;
    but JPA repositories are not subject for unit tests

From other hand the benefits of using integration tests with real database instance are following:




Test Containers

Test container life circle management

...