Search in sources :

Example 6 with NoEntityFoundException

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

the class PnfResourceRepositoryTest method findResourceById_validUuid_expectedOutput.

@Test
public void findResourceById_validUuid_expectedOutput() throws Exception {
    PnfResource pnfResource = pnfResourceRepository.findById("ff2ae348-214a-11e7-93ae-92361f002680").orElseThrow(() -> new NoEntityFoundException("Cannot Find Entity"));
    checkPnfResource(pnfResource);
}
Also used : PnfResource(org.onap.so.db.catalog.beans.PnfResource) NoEntityFoundException(org.onap.so.db.catalog.exceptions.NoEntityFoundException) BaseTest(org.onap.so.db.catalog.BaseTest) Test(org.junit.Test)

Example 7 with NoEntityFoundException

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

the class VnfcCustomizationRepositoryTest method findAllTest.

@Test
@Transactional
public void findAllTest() throws Exception {
    List<VnfcCustomization> vnfcCustomizationList = vnfcCustomizationRepository.findAll();
    Assert.assertFalse(CollectionUtils.isEmpty(vnfcCustomizationList));
    VnfcCustomization vnfcCustomization = vnfcCustomizationRepository.findById("9bcce658-9b37-11e8-98d0-529269fb1459").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
    Assert.assertTrue(vnfcCustomization.getDescription().equalsIgnoreCase("testVnfcCustomizationDescription"));
}
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)

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