Springboot 2.0 upgrade
[so.git] / mso-api-handlers / mso-requests-db-repositories / src / test / java / org / onap / so / db / request / OperationalEnvServiceModelStatusTest.java
index c12d3cb..ef34662 100644 (file)
@@ -27,6 +27,7 @@ import org.junit.runner.RunWith;
 import org.onap.so.TestApplication;
 import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus;
 import org.onap.so.db.request.data.repository.OperationalEnvServiceModelStatusRepository;
+import org.onap.so.db.request.exceptions.NoEntityFoundException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.data.domain.Example;
@@ -71,7 +72,8 @@ public class OperationalEnvServiceModelStatusTest {
                exampleObj.setOperationalEnvId("oper-env-id-1");
                exampleObj.setServiceModelVersionId("service-model-ver-id-1");
                ExampleMatcher matcher = ExampleMatcher.matching().withIgnorePaths("requestId");
-               OperationalEnvServiceModelStatus foundStatus = repository.findOne(Example.of(exampleObj,matcher));
+               OperationalEnvServiceModelStatus foundStatus = repository.findOne(Example.of(exampleObj,matcher))
+                               .orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
                if(foundStatus== null)
                        throw new Exception("No status found");