2 * Copyright (c) 2016, 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.applications.frm.impl;
10 import org.junit.Assert;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.junit.runner.RunWith;
14 import org.mockito.junit.MockitoJUnitRunner;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
18 * Test for {@link DeviceMastership}.
20 @RunWith(MockitoJUnitRunner.class)
21 public class DeviceMastershipTest {
22 private static final NodeId NODE_ID = new NodeId("testNode");
23 private DeviceMastership deviceMastership;
26 public void setUp() throws Exception {
27 deviceMastership = new DeviceMastership(NODE_ID);
31 public void testInstantiateServiceInstance() {
32 deviceMastership.instantiateServiceInstance();
33 Assert.assertTrue(deviceMastership.isDeviceMastered());
37 public void testCloseServiceInstance() {
38 deviceMastership.closeServiceInstance();
39 Assert.assertFalse(deviceMastership.isDeviceMastered());