Modernize codebase a bit
[bgpcep.git] / bgp / openconfig-state / src / test / java / org / opendaylight / protocol / bgp / state / GlobalUtilTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.bgp.state;
9
10 import static org.junit.Assert.assertNull;
11 import static org.mockito.ArgumentMatchers.eq;
12 import static org.mockito.Mockito.doReturn;
13 import static org.opendaylight.protocol.bgp.state.StateProviderImplTest.TABLES_KEY;
14
15 import java.util.Optional;
16 import org.junit.Before;
17 import org.junit.Test;
18 import org.mockito.Mock;
19 import org.mockito.MockitoAnnotations;
20 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
21 import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
22
23 public class GlobalUtilTest {
24     @Mock
25     private BGPRibState ribState;
26     @Mock
27     private BGPTableTypeRegistryConsumer tableRegistry;
28
29     @Before
30     public void setUp() throws Exception {
31         MockitoAnnotations.initMocks(this);
32         doReturn(Optional.empty()).when(this.tableRegistry).getAfiSafiType(eq(TABLES_KEY));
33     }
34
35     @Test
36     public void testNonSupportedAfiSafi() {
37         assertNull(GlobalUtil.buildAfiSafi(this.ribState, TABLES_KEY, this.tableRegistry));
38     }
39 }