updatd test in RequestValidationExceptionTest.java 17/57917/2
authorSandeep J <sandeejh@in.ibm.com>
Fri, 27 Jul 2018 21:00:52 +0000 (02:30 +0530)
committerTakamune Cho <tc012c@att.com>
Sun, 29 Jul 2018 21:23:16 +0000 (21:23 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Id2a2f7f2476f4a6d2f917c713af374cd0d02f682
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/onap/appc/requesthandler/exceptions/RequestValidationExceptionTest.java

index 2099d9d..caeab72 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================ 
  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. 
  * ============================================================================= 
+ * Modifications Copyright (C) 2018 IBM. 
+ * ============================================================================= 
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
  * You may obtain a copy of the License at 
@@ -25,13 +27,22 @@ import org.junit.Test;
 import org.onap.appc.executor.objects.LCMCommandStatus;
 import org.onap.appc.executor.objects.Params;
 
+import junit.framework.Assert;
+
 public class RequestValidationExceptionTest {
+    @SuppressWarnings("deprecation")
     @Test
     public final void testRequestValidationExceptionWithParams() {
         String message = "tesingMessage";
         String command = "tesingCommand";
         Params p = new Params().addParam("actionName", command);
         RequestValidationException rve = new RequestValidationException(message, LCMCommandStatus.MISSING_MANDATORY_PARAMETER, p);
+        rve.setLogMessage("testLogMessage");
+        Assert.assertEquals("testLogMessage", rve.getLogMessage());
+        rve.setTargetEntity("testTargetEntity");
+        Assert.assertEquals("testTargetEntity", rve.getTargetEntity());
+        rve.setTargetService("testTargetService");
+        Assert.assertEquals("testTargetService", rve.getTargetService());
         assertNotNull(rve.getParams());
         assertNotNull(rve.getMessage());
     }