Search in sources :

Example 1 with NoEntityFoundException

use of org.onap.so.db.catalog.exceptions.NoEntityFoundException in project so by onap.

the class VnfcCustomizationRepositoryTest method createAndGetTest.

@Test
@Transactional
public void createAndGetTest() throws Exception {
    VnfcCustomization vnfcCustomization = setUpVnfcCustomization();
    vnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
    vnfcCustomizationRepository.save(vnfcCustomization);
    VnfcCustomization foundVnfcCustomization = vnfcCustomizationRepository.findById("cf9f6efc-9f14-11e8-98d0-529269fb1459").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    assertThat(vnfcCustomization, sameBeanAs(foundVnfcCustomization).ignoring("created"));
}
Also used : NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) VnfcCustomization(org.onap.so.db.catalog.beans.VnfcCustomization) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with NoEntityFoundException

use of org.onap.so.db.catalog.exceptions.NoEntityFoundException in project so by onap.

the class PnfCustomizationRepositoryTest method findById_ValidUuid_ExpectedOutput.

@Test
public void findById_ValidUuid_ExpectedOutput() throws Exception {
    PnfResourceCustomization pnfResourceCustomization = pnfCustomizationRepository.findById("68dc9a92-214c-11e7-93ae-92361f002680").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    checkPnfResourceCustomization(pnfResourceCustomization);
}
Also used : PnfResourceCustomization(org.onap.so.db.catalog.beans.PnfResourceCustomization) NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Example 3 with NoEntityFoundException

use of org.onap.so.db.catalog.exceptions.NoEntityFoundException in project so by onap.

the class CloudSiteRepositoryTest method findOneTest.

@Test
public void findOneTest() throws Exception {
    CloudSite cloudSite = cloudSiteRepository.findById("mtn13").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    Assert.assertNotNull(cloudSite);
    Assert.assertEquals("mtn13", cloudSite.getId());
}
Also used : CloudSite(org.onap.so.db.catalog.beans.CloudSite) NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Example 4 with NoEntityFoundException

use of org.onap.so.db.catalog.exceptions.NoEntityFoundException in project so by onap.

the class VnfcInstanceGroupCustomizationRepositoryTest method findAllTest.

@Test
public void findAllTest() throws Exception {
    List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizationList = vnfcInstanceGroupCustomizationRepository.findAll();
    Assert.assertFalse(CollectionUtils.isEmpty(vnfcInstanceGroupCustomizationList));
    VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization = vnfcInstanceGroupCustomizationRepository.findById(1450).orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    Assert.assertTrue(vnfcInstanceGroupCustomization.getFunction().equalsIgnoreCase("FUNCTION"));
}
Also used : NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) VnfcInstanceGroupCustomization(org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Example 5 with NoEntityFoundException

use of org.onap.so.db.catalog.exceptions.NoEntityFoundException in project so by onap.

the class CloudifyManagerRepositoryTest method findOneTest.

@Test
public void findOneTest() throws Exception {
    CloudifyManager cloudifyManager = cloudifyManagerRepository.findById("mtn13").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    Assert.assertNotNull(cloudifyManager);
    Assert.assertEquals("mtn13", cloudifyManager.getId());
}
Also used : CloudifyManager(org.onap.so.db.catalog.beans.CloudifyManager) NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 BaseTest (org.onap.so.db.catalog.BaseTest)7 NoEntityFoundException (org.onap.so.db.catalog.exceptions.NoEntityFoundException)7 VnfcCustomization (org.onap.so.db.catalog.beans.VnfcCustomization)2 Transactional (org.springframework.transaction.annotation.Transactional)2 CloudSite (org.onap.so.db.catalog.beans.CloudSite)1 CloudifyManager (org.onap.so.db.catalog.beans.CloudifyManager)1 PnfResource (org.onap.so.db.catalog.beans.PnfResource)1 PnfResourceCustomization (org.onap.so.db.catalog.beans.PnfResourceCustomization)1 VnfcInstanceGroupCustomization (org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization)1