2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 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 package org.onap.aaf.auth.direct.test;
23 import static org.mockito.MockitoAnnotations.initMocks;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.junit.runner.RunWith;
28 import org.mockito.Mock;
29 import org.mockito.Mockito;
30 import org.mockito.runners.MockitoJUnitRunner;
31 import org.onap.aaf.auth.dao.cass.LocateDAO;
32 import org.onap.aaf.auth.dao.cass.LocateDAO.Data;
33 import org.onap.aaf.auth.direct.DirectRegistrar;
34 import org.onap.aaf.auth.env.AuthzEnv;
35 import org.onap.aaf.auth.env.AuthzTrans;
36 import org.onap.aaf.auth.layer.Result;
37 import org.onap.aaf.cadi.Access;
38 import org.onap.aaf.cadi.CadiException;
39 import org.onap.aaf.cadi.config.Config;
42 @RunWith(MockitoJUnitRunner.class)
43 public class JU_DirectRegistrar {
61 public void setUp() throws Exception {
66 public void testUpdate() {
67 DirectRegistrar registrarObj=null;
69 Mockito.doReturn("20").when(access).getProperty(Config.CADI_LATITUDE,null);
70 Mockito.doReturn("20").when(access).getProperty(Config.CADI_LONGITUDE,null);
71 Mockito.doReturn("20").when(access).getProperty(Config.AAF_LOCATOR_CONTAINER,"");
72 registrarObj = new DirectRegistrar( access, ldao, 9080);
73 } catch (CadiException e) {
74 // TODO Auto-generated catch block
77 org.onap.aaf.auth.layer.Result<Void> retVal1 = new Result<Void>(null,0,"test",new String[0]);
78 Mockito.doReturn(trans).when(env).newTransNoAvg();
79 // Mockito.doReturn(retVal1).when(ldao).update(trans,locate);
80 registrarObj.update(env);
81 // System.out.println(retVal1);