e9bd799c3605299541a63ec10e1a4890601c7d85
[aaf/authz.git] / cadi / core / src / test / java / org / onap / aaf / cadi / principal / test / JU_Kind.java
1 /*******************************************************************************
2  * ============LICENSE_START====================================================
3  * * org.onap.aaf
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
10  * * 
11  *  *      http://www.apache.org/licenses/LICENSE-2.0
12  * * 
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====================================================
19  * *
20  * *
21  ******************************************************************************/
22
23 package org.onap.aaf.cadi.principal.test;
24
25 import static org.junit.Assert.*;
26 import static org.hamcrest.CoreMatchers.*;
27 import org.junit.*;
28 import org.mockito.Mock;
29 import org.mockito.MockitoAnnotations;
30
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;
36
37 public class JU_Kind {
38
39         @Mock
40         private TrustPrincipal trust;
41
42         @Mock
43         private X509Principal x509;
44
45         @Mock
46         private OAuth2FormPrincipal oauth;
47
48         @Mock
49         private BasicPrincipal basic;
50
51         @Before
52         public void setup() throws SecurityException {
53                 MockitoAnnotations.initMocks(this);
54         }
55
56         @Test
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'));
62         }
63
64         @Test
65         public void coverageTest() {
66                 @SuppressWarnings("unused")
67                 Kind kind = new Kind();
68         }
69
70 }