summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-11 21:58:39 +0530
committerDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-11 22:00:22 +0530
commit275fde00f4bbecf513cfbaf4e0d1bb3007c61cd3 (patch)
tree43a65a3a7ec259fb0d780fa6e8a1069ad8388f63 /auth/auth-core/src
parent561d678e8e7816d93efc44d1027dac29691ebb0b (diff)
Junit test file for FacadeImpl.java
Junit test file for FacadeImpl.java Issue-ID: AAF-716 Change-Id: Ic9665fab2eb5b0cd8b021b90b4d65f99c34cda3f Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
Diffstat (limited to 'auth/auth-core/src')
-rw-r--r--auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java64
1 files changed, 64 insertions, 0 deletions
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java
new file mode 100644
index 00000000..241622fc
--- /dev/null
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * ============LICENSE_START====================================================
+ * * org.onap.aaf
+ * * ===========================================================================
+ * * Copyright © 2019 IBM Intellectual Property. All rights reserved.
+ * * ===========================================================================
+ * * 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
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License.
+ * * ============LICENSE_END====================================================
+ * *
+ * *
+ ******************************************************************************/
+
+package org.onap.aaf.auth.layer;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.aaf.misc.env.Data.TYPE;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class FacadeImplTest {
+
+ FacadeImpl facade;
+ HttpServletResponse response;
+
+ @Before
+ public void setUp() throws Exception {
+ facade = new FacadeImpl() {
+ };
+ response = mock(HttpServletResponse.class);
+ }
+
+ @Test
+ public void setContentType() {
+ TYPE type = TYPE.JSON;
+ facade.setContentType(response, type);
+ verify(response).setContentType("application/json");
+
+ type = TYPE.XML;
+ facade.setContentType(response, type);
+ verify(response).setContentType("text.xml");
+ }
+
+ @Test
+ public void setCacheControlOff() {
+ facade.setCacheControlOff(response);
+ verify(response).setHeader("Cache-Control", "no-store");
+ verify(response).setHeader("Pragma", "no-cache");
+ }
+} \ No newline at end of file