diff options
author | Jonathan Gathman <jonathan.gathman@att.com> | 2019-01-22 12:16:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-22 12:16:18 +0000 |
commit | db821a31efd79fa0f7b9a30b4d5550efdc1476bd (patch) | |
tree | 6b906fe14182247503b37055e265e3caf3fab5cd /auth | |
parent | b61ed0b72faf201e90704f9f0d42627c290c8d89 (diff) | |
parent | 275fde00f4bbecf513cfbaf4e0d1bb3007c61cd3 (diff) |
Merge "Junit test file for FacadeImpl.java"
Diffstat (limited to 'auth')
-rw-r--r-- | auth/auth-core/src/test/java/org/onap/aaf/auth/layer/FacadeImplTest.java | 64 |
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 |