Springboot 2.0 upgrade
[so.git] / mso-catalog-db / src / test / java / org / onap / so / db / catalog / data / repository / CloudifyManagerRepositoryTest.java
index 34c22b0..1ed8c84 100644 (file)
@@ -24,6 +24,7 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.onap.so.db.catalog.BaseTest;
 import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public class CloudifyManagerRepositoryTest extends BaseTest {
@@ -33,7 +34,8 @@ public class CloudifyManagerRepositoryTest extends BaseTest {
 
     @Test
     public void findOneTest() throws Exception {
-        CloudifyManager cloudifyManager = cloudifyManagerRepository.findOne("mtn13");
+        CloudifyManager cloudifyManager = cloudifyManagerRepository.findById("mtn13")
+                       .orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
         Assert.assertNotNull(cloudifyManager);
         Assert.assertEquals("mtn13", cloudifyManager.getId());
     }