diff options
author | 2021-01-11 16:44:32 +0200 | |
---|---|---|
committer | 2021-01-13 10:18:31 +0000 | |
commit | 49fe075361e4f0f3b2a1a561bc01f831983a3efb (patch) | |
tree | a4cd3e36428f0d3d922e01c22700344088dd4bd2 /cps-ri/src/test/java | |
parent | a6c59f024092ac339d851a372aa6deae36de622d (diff) |
Decouple anchor from fragment in persistence module
Issue-ID: CPS-161
Change-Id: Ia446b26ee4eca9281e86bd2be3dd6836aa201597
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Diffstat (limited to 'cps-ri/src/test/java')
-rw-r--r-- | cps-ri/src/test/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceTest.java b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceTest.java index 7497526f9..e5aac1eea 100644 --- a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceTest.java +++ b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceTest.java @@ -29,15 +29,15 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.cps.DatabaseTestContainer; import org.onap.cps.spi.CpsAdminPersistenceService; +import org.onap.cps.spi.entities.AnchorEntity; import org.onap.cps.spi.entities.Dataspace; -import org.onap.cps.spi.entities.Fragment; import org.onap.cps.spi.exceptions.AnchorAlreadyDefinedException; import org.onap.cps.spi.exceptions.DataspaceAlreadyDefinedException; import org.onap.cps.spi.exceptions.DataspaceNotFoundException; import org.onap.cps.spi.exceptions.SchemaSetNotFoundException; import org.onap.cps.spi.model.Anchor; +import org.onap.cps.spi.repository.AnchorRepository; import org.onap.cps.spi.repository.DataspaceRepository; -import org.onap.cps.spi.repository.FragmentRepository; import org.onap.cps.spi.repository.SchemaSetRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -69,7 +69,7 @@ public class CpsAdminPersistenceServiceTest { private CpsAdminPersistenceService cpsAdminPersistenceService; @Autowired - private FragmentRepository fragmentRepository; + private AnchorRepository anchorRepository; @Autowired private DataspaceRepository dataspaceRepository; @@ -102,13 +102,13 @@ public class CpsAdminPersistenceServiceTest { // validate anchor persisted final Dataspace dataspace = dataspaceRepository.findByName(DATASPACE_NAME).orElseThrow(); - final Fragment anchor = - fragmentRepository.findByDataspaceAndAnchorName(dataspace, ANCHOR_NAME_NEW).orElseThrow(); + final AnchorEntity anchorEntity = + anchorRepository.findByDataspaceAndName(dataspace, ANCHOR_NAME_NEW).orElseThrow(); - assertNotNull(anchor.getId()); - assertEquals(ANCHOR_NAME_NEW, anchor.getAnchorName()); - assertEquals(DATASPACE_NAME, anchor.getDataspace().getName()); - assertEquals(SCHEMA_SET_NAME2, anchor.getSchemaSet().getName()); + assertNotNull(anchorEntity.getId()); + assertEquals(ANCHOR_NAME_NEW, anchorEntity.getName()); + assertEquals(DATASPACE_NAME, anchorEntity.getDataspace().getName()); + assertEquals(SCHEMA_SET_NAME2, anchorEntity.getSchemaSet().getName()); } @Test(expected = DataspaceNotFoundException.class) |