aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/crud/service
diff options
context:
space:
mode:
authorSotiropoulos, Ioannis (is948x) <Ioannis.Sotiropoulos@amdocs.com>2018-07-10 17:57:43 +0100
committerSotiropoulos, Ioannis (is948x) <Ioannis.Sotiropoulos@amdocs.com>2018-07-10 17:57:43 +0100
commitd5322dbd0fa1e32d543b24824a28d6bf0a0b5497 (patch)
tree3fd9c7c2ce924395346601490e96327e47928afc /src/main/java/org/onap/crud/service
parent600ca7e0b82c6932caa4f4ffb53e6c053525d9d5 (diff)
Increase code coverage
Add tests to increase code coverage above 60 percent. Issue-ID: AAI-1198 Change-Id: I4c2f964ce41d01521cc1313e32e34fb6460d49bf Signed-off-by: Sotiropoulos, Ioannis (is948x) <Ioannis.Sotiropoulos@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/crud/service')
-rw-r--r--src/main/java/org/onap/crud/service/AaiResourceService.java5
-rw-r--r--src/main/java/org/onap/crud/service/CrudAsyncGraphEventCache.java6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/onap/crud/service/AaiResourceService.java b/src/main/java/org/onap/crud/service/AaiResourceService.java
index 881f9fd..c2e0338 100644
--- a/src/main/java/org/onap/crud/service/AaiResourceService.java
+++ b/src/main/java/org/onap/crud/service/AaiResourceService.java
@@ -169,8 +169,9 @@ public class AaiResourceService {
ImmutablePair<EntityTag, String> result = graphDataService.addEdge(EdgeRulesLoader.getLatestSchemaVersion(), type, payload);
response = Response.status(Status.CREATED).entity(result.getValue()).tag(result.getKey()).type(mediaType).build();
- } catch (CrudException e) {
-
+ } catch (CrudException ce) {
+ response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build();
+ } catch (Exception e) {
response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
}
}
diff --git a/src/main/java/org/onap/crud/service/CrudAsyncGraphEventCache.java b/src/main/java/org/onap/crud/service/CrudAsyncGraphEventCache.java
index 3457cff..ff5170a 100644
--- a/src/main/java/org/onap/crud/service/CrudAsyncGraphEventCache.java
+++ b/src/main/java/org/onap/crud/service/CrudAsyncGraphEventCache.java
@@ -20,17 +20,15 @@
*/
package org.onap.crud.service;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-
import java.util.concurrent.TimeUnit;
-
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.crud.logging.CrudServiceMsgs;
import org.onap.crud.service.CrudAsyncGraphDataService.CollectGraphResponse;
import org.onap.crud.util.CrudProperties;
import org.onap.crud.util.CrudServiceConstants;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
/**
* Self expiring Cache to hold request transactionIds . Events are expired