Versions Compared

Key

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

Table Of Contents

Table of Contents
Addresses 

Addresses:

  • 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

Overview

The CPS-RI module which is responsible for data persistence and retrieval from the database is based on
Spring Data framework. Following components are used:

  • Persistence service implementations (logic layer) → these are defined as Java classes
  • JPA repositories (data access layer) → these are defined as Java interfaces, corresponding objects
    are created by Spring framework at runtime

In order to reach the desirable level of reliability it's expected the functionality to be covered with tests.

draw.io Diagram
borderfalse
diagramNameCPS DB Testing Unit vs Integration
simpleViewerfalse
width
linksauto
tbstyleinline
diagramDisplayName
lboxfalse
diagramWidth741
revision2
In order to reach the desirable level of reliability it's expected the functionality to be covered with tests

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,
    database driver and database itself) remain not involved (not tested)



Test Containers

Test container life circle management

Database initialization notes


@SpringBootTest


Test template


Resources