1 /*******************************************************************************
2 * ============LICENSE_START====================================================
4 * * ===========================================================================
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * * ===========================================================================
7 * * Licensed under the Apache License, Version 2.0 (the "License");
8 * * you may not use this file except in compliance with the License.
9 * * You may obtain a copy of the License at
11 * * http://www.apache.org/licenses/LICENSE-2.0
13 * * Unless required by applicable law or agreed to in writing, software
14 * * distributed under the License is distributed on an "AS IS" BASIS,
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * * See the License for the specific language governing permissions and
17 * * limitations under the License.
18 * * ============LICENSE_END====================================================
21 ******************************************************************************/
23 package org.onap.aaf.cadi.principal.test;
25 import static org.junit.Assert.*;
26 import static org.hamcrest.CoreMatchers.*;
28 import org.mockito.Mock;
29 import org.mockito.MockitoAnnotations;
31 import org.onap.aaf.cadi.principal.BasicPrincipal;
32 import org.onap.aaf.cadi.principal.Kind;
33 import org.onap.aaf.cadi.principal.OAuth2FormPrincipal;
34 import org.onap.aaf.cadi.principal.TrustPrincipal;
35 import org.onap.aaf.cadi.principal.X509Principal;
37 public class JU_Kind {
40 private TrustPrincipal trust;
43 private X509Principal x509;
46 private OAuth2FormPrincipal oauth;
49 private BasicPrincipal basic;
52 public void setup() throws SecurityException {
53 MockitoAnnotations.initMocks(this);
57 public void getKind() {
58 assertThat(Kind.getKind(trust), is('U'));
59 assertThat(Kind.getKind(x509), is('X'));
60 assertThat(Kind.getKind(oauth), is('O'));
61 assertThat(Kind.getKind(basic), is('B'));
65 public void coverageTest() {
66 @SuppressWarnings("unused")
67 Kind kind = new Kind();