3 * ============LICENSE_START====================================================
5 * ===========================================================================
6 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
7 * ===========================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END====================================================
23 package org.onap.aaf.cadi.taf.dos.test;
25 import static org.hamcrest.CoreMatchers.is;
26 import static org.junit.Assert.assertThat;
28 import java.io.ByteArrayOutputStream;
29 import java.io.IOException;
30 import java.io.PrintStream;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.onap.aaf.cadi.PropAccess;
35 import org.onap.aaf.cadi.taf.TafResp.RESP;
36 import org.onap.aaf.cadi.taf.dos.DenialOfServiceTafResp;
38 public class JU_DenialOfServiceTafResp {
40 private final static String description = "description";
41 private final static RESP status = RESP.IS_AUTHENTICATED;
43 private PropAccess access;
47 access = new PropAccess(new PrintStream(new ByteArrayOutputStream()), new String[0]);
51 public void test() throws IOException {
52 DenialOfServiceTafResp resp = new DenialOfServiceTafResp(access, status, description);
53 assertThat(resp.isAuthenticated(), is(status));
54 assertThat(resp.authenticate(), is(status));