aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
authorPrudence Au <prudence.au@amdocs.com>2018-08-21 15:35:51 -0400
committerPrudence Au <prudence.au@amdocs.com>2018-08-21 15:51:02 -0400
commit4941e70b8bd9700be474d3ebe40def9d70d23693 (patch)
tree9ce6bbe4e2472fc900608239deac052a39dfd125 /src/main/java/org/onap
parentb1b32354811fd9c856bf9ce611d36591d7a81404 (diff)
Add JUnit tests
Change-Id: Iedc215a9d77670a697822683457e7eeb4a7cc335 Issue-ID: LOG-521 Signed-off-by: Prudence Au <prudence.au@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java2
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/exception/AuditException.java10
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java2
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java4
4 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
index 26949ed..6346d3a 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
@@ -267,7 +267,7 @@ public class VnfInstance {
return orchestrationStatus;
}
- public void setoOrchestrationStatus(String orchestrationStatus) {
+ public void setOrchestrationStatus(String orchestrationStatus) {
this.orchestrationStatus = orchestrationStatus;
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/exception/AuditException.java b/src/main/java/org/onap/pomba/contextbuilder/aai/exception/AuditException.java
index 042c651..d78ff84 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/exception/AuditException.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/exception/AuditException.java
@@ -32,16 +32,6 @@ public class AuditException extends Exception {
super(message);
}
- /**
- * Constructor for an instance of this exception with a message and status.
- * @param httpStatus
- * @param message
- */
- public AuditException(Status httpStatus, String message) {
- super(message);
- this.httpStatus = httpStatus;
- }
-
public AuditException(String message, Status httpStatus) {
super(message);
this.setHttpStatus(httpStatus);
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
index 989dbc3..9a542a4 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/service/SpringServiceImpl.java
@@ -47,7 +47,7 @@ public class SpringServiceImpl implements SpringService {
String url = "serviceInstanceId=" + serviceInstanceId + " modelVersion="+modelVersionId +
" modelInvariantId="+ modelInvariantId + " serviceType="+serviceType + " customerId="+ customerId;
- log.info(LogMessages.AAI_CONTEXT_BUILDER_URL + url);
+ log.info(LogMessages.AAI_CONTEXT_BUILDER_URL, url);
ModelContext context = null;
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
index 8681d21..a997ebc 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
@@ -121,10 +121,10 @@ public class RestUtil {
authorization = headers.getRequestHeaders().getFirst(AUTHORIZATION);
if (authorization != null && !authorization.trim().isEmpty() && authorization.startsWith("Basic")) {
if (!authorization.equals(basicAuthorization)) {
- throw new AuditException(Status.UNAUTHORIZED, AuditError.MISMATCH);
+ throw new AuditException(AuditError.MISMATCH, Status.UNAUTHORIZED);
};
} else {
- throw new AuditException(Status.UNAUTHORIZED, AuditError.MISSING_AUTHORIZATION_HEADER);
+ throw new AuditException(AuditError.MISSING_AUTHORIZATION_HEADER, Status.UNAUTHORIZED);
}
}