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 ******************************************************************************/
22 package org.onap.aaf.auth.org.test;
24 import org.junit.Before;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.mockito.Mock;
28 import static org.mockito.Mockito.mock;
29 import org.onap.aaf.auth.env.AuthzEnv;
30 import org.onap.aaf.auth.org.OrganizationException;
31 import org.onap.aaf.auth.org.OrganizationFactory;
32 import org.onap.aaf.misc.env.APIException;
33 import org.onap.aaf.misc.env.impl.BasicEnv;
34 import org.powermock.api.mockito.PowerMockito;
35 import org.powermock.modules.junit4.PowerMockRunner;
37 @RunWith(PowerMockRunner.class)
38 public class JU_OrganizationFactory {
39 private static final String ORG_SLOT = null;
40 OrganizationFactory organizationFactory;
43 AuthzEnv authzEnvMock;
44 String orgClass="orgclass";
48 organizationFactory = new OrganizationFactory();
49 bEnv = new BasicEnv();
52 @SuppressWarnings("static-access")
53 @Test(expected = APIException.class)
54 public void testInit() throws OrganizationException {
55 organizationFactory.init(bEnv);
58 // @SuppressWarnings("static-access") TODO:Fix this AAF-111
59 // @Test(expected = OrganizationException.class)
60 // public void testObtain() throws OrganizationException{
61 // PowerMockito.when(authzEnvMock.getProperty("Organization."+orgNS)).thenReturn("notnull");
62 // organizationFactory.obtain(authzEnvMock, orgNS);