Update css file name in conf.py
[policy/engine.git] / ONAP-SDK-APP / src / test / java / org / onap / portalapp / scheduler / RegistryAdapterTest.java
1 /*-
2  * ================================================================================
3  * ONAP Portal SDK
4  * ================================================================================
5  * Copyright (C) 2018 AT&T Intellectual Property
6  * ================================================================================
7  * Modifications Copyright (C) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ================================================================================
21  */
22
23 package org.onap.portalapp.scheduler;
24
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.fail;
27 import org.junit.Rule;
28 import org.junit.Test;
29 import org.junit.rules.ExpectedException;
30 import org.onap.portalsdk.core.scheduler.Registerable;
31 import org.onap.portalsdk.workflow.services.WorkflowScheduleService;
32 import org.springframework.scheduling.quartz.SchedulerFactoryBean;
33
34 public class RegistryAdapterTest {
35     @Rule
36     public final ExpectedException thrown = ExpectedException.none();
37
38     @Test
39     public void testRegistryAdapter() {
40         RegistryAdapter adapter = new RegistryAdapter();
41         SchedulerFactoryBean schedulerBean = new SchedulerFactoryBean();
42         Registerable registry = null;
43         WorkflowScheduleService workflowScheduleService = null;
44
45         adapter.setSchedulerBean(schedulerBean);
46         assertEquals(adapter.getSchedulerBean(), schedulerBean);
47         adapter.setRegistry(registry);
48         assertEquals(adapter.getRegistry(), registry);
49         adapter.setWorkflowScheduleService(workflowScheduleService);
50         assertEquals(adapter.getWorkflowScheduleService(), workflowScheduleService);
51     }
52
53     @Test
54     public void testRegistryAdapterNegCase1() {
55         thrown.expect(NullPointerException.class);
56
57         RegistryAdapter adapter = new RegistryAdapter();
58         adapter.getTriggers();
59         fail("Expecting an exception.");
60     }
61
62     @Test
63     public void testRegistryAdapterNegCase2() {
64         thrown.expect(NullPointerException.class);
65
66         RegistryAdapter adapter = new RegistryAdapter();
67         adapter.addCoreTriggers();
68         fail("Expecting an exception.");
69     }
70 }