Remove useless tests 09/80209/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 7 Feb 2019 13:38:48 +0000 (14:38 +0100)
committerSam Hague <shague@redhat.com>
Thu, 7 Feb 2019 16:01:06 +0000 (16:01 +0000)
These tests are not asserting anything at all, remove them to reduce
static mocking proliferation for no value whatsoever.

Change-Id: I53b21da97d7b9c7cf6e64543e6fe73f2c08267e9
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a6fd54eedf2f7275d43ac4da351b5c3abf8302d)

southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeRemovedCommandTest.java [deleted file]
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeUpdateCommandTest.java [deleted file]
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerRemovedCommandTest.java [deleted file]
southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerUpdateCommandTest.java [deleted file]

diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeRemovedCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeRemovedCommandTest.java
deleted file mode 100644 (file)
index e5b4be3..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015 Inocybe Technologies. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.southbound.ovsdb.transact;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.ovsdb.southbound.InstanceIdentifierCodec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@PrepareForTest({BridgeRemovedCommand.class, TransactUtils.class})
-@RunWith(PowerMockRunner.class)
-public class BridgeRemovedCommandTest {
-
-    private BridgeRemovedCommand briRemovedCmd = new BridgeRemovedCommand();
-    @Mock private DataChangeEvent changes;
-    @Mock private DataChangeEvent returnChanges;
-    private final Set<InstanceIdentifier<OvsdbBridgeAugmentation>> removed = new HashSet<>();
-    private final Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> originals = new HashMap<>();
-
-    @Before
-    public void setUp() throws Exception {
-        briRemovedCmd = mock(BridgeRemovedCommand.class, Mockito.CALLS_REAL_METHODS);
-    }
-
-    @Test
-    public void testExecute() throws Exception {
-        PowerMockito.mockStatic(TransactUtils.class);
-        when(TransactUtils.extractRemoved(changes, OvsdbBridgeAugmentation.class)).thenReturn(removed);
-        when(TransactUtils.extractOriginal(changes, OvsdbBridgeAugmentation.class)).thenReturn(originals);
-
-        TransactionBuilder transaction = mock(TransactionBuilder.class, Mockito.RETURNS_MOCKS);
-        briRemovedCmd.execute(transaction, mock(BridgeOperationalState.class), changes,
-                mock(InstanceIdentifierCodec.class));
-
-        // TODO Actually verify something
-    }
-
-}
diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeUpdateCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeUpdateCommandTest.java
deleted file mode 100644 (file)
index 0b3a1c5..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2015 Inocybe Technologies. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.southbound.ovsdb.transact;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.ovsdb.southbound.InstanceIdentifierCodec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@PrepareForTest({BridgeUpdateCommand.class, TransactUtils.class})
-@RunWith(PowerMockRunner.class)
-public class BridgeUpdateCommandTest {
-
-    @Mock private BridgeUpdateCommand briUpdatedCmd;
-    @Mock private DataChangeEvent changes;
-    @Mock private DataChangeEvent returnChanges;
-    @Mock private Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> created;
-    @Mock private Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> updated;
-
-    @Before
-    public void setUp() throws Exception {
-        briUpdatedCmd = mock(BridgeUpdateCommand.class, Mockito.CALLS_REAL_METHODS);
-    }
-
-    @Test
-    public void testExecute() {
-        PowerMockito.mockStatic(TransactUtils.class);
-        when(TransactUtils.extractCreated(changes, OvsdbBridgeAugmentation.class)).thenReturn(created);
-        when(TransactUtils.extractUpdated(changes, OvsdbBridgeAugmentation.class)).thenReturn(updated);
-
-        TransactionBuilder transaction = mock(TransactionBuilder.class, Mockito.RETURNS_MOCKS);
-        briUpdatedCmd.execute(transaction, mock(BridgeOperationalState.class), changes,
-                mock(InstanceIdentifierCodec.class));
-
-        // TODO Actually verify something
-    }
-
-}
diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerRemovedCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerRemovedCommandTest.java
deleted file mode 100644 (file)
index 24534ed..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2015 Inocybe Technologies. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.southbound.ovsdb.transact;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.ovsdb.southbound.InstanceIdentifierCodec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@PrepareForTest({ControllerRemovedCommand.class, TransactUtils.class})
-@RunWith(PowerMockRunner.class)
-public class ControllerRemovedCommandTest {
-
-    private ControllerRemovedCommand contRemoveCmd = new ControllerRemovedCommand();
-    @Mock private DataChangeEvent changes;
-    @Mock private DataChangeEvent returnChanges;
-    private final Set<InstanceIdentifier<ControllerEntry>> removed = new HashSet<>();
-    private final Map<InstanceIdentifier<ControllerEntry>, ControllerEntry> operationalControllerEntries =
-            new HashMap<>();
-    private final Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> created = new HashMap<>();
-    private final Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> updated = new HashMap<>();
-
-    @Before
-    public void setUp() throws Exception {
-        contRemoveCmd = mock(ControllerRemovedCommand.class, Mockito.CALLS_REAL_METHODS);
-    }
-
-    @Test
-    public void testExecute() throws Exception {
-        PowerMockito.mockStatic(TransactUtils.class);
-        when(TransactUtils.extractRemoved(changes, ControllerEntry.class)).thenReturn(removed);
-        when(TransactUtils.extractOriginal(changes, ControllerEntry.class)).thenReturn(operationalControllerEntries);
-        when(TransactUtils.extractCreated(changes, OvsdbBridgeAugmentation.class)).thenReturn(created);
-        when(TransactUtils.extractUpdated(changes, OvsdbBridgeAugmentation.class)).thenReturn(updated);
-
-        TransactionBuilder transaction = mock(TransactionBuilder.class, Mockito.RETURNS_MOCKS);
-        contRemoveCmd.execute(transaction, null, changes, mock(InstanceIdentifierCodec.class));
-
-        // TODO Actually verify something
-    }
-
-}
diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerUpdateCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/ControllerUpdateCommandTest.java
deleted file mode 100644 (file)
index 10fc58a..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2015 Inocybe Technologies. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.ovsdb.southbound.ovsdb.transact;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Map;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
-import org.opendaylight.ovsdb.southbound.InstanceIdentifierCodec;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@PrepareForTest({ControllerUpdateCommand.class, TransactUtils.class})
-@RunWith(PowerMockRunner.class)
-public class ControllerUpdateCommandTest {
-
-    @Mock private ControllerUpdateCommand contUpdateCmd;
-    @Mock private DataChangeEvent changes;
-    @Mock private DataChangeEvent returnChanges;
-    @Mock private Map<InstanceIdentifier<ControllerEntry>, ControllerEntry> controllers;
-    @Mock private Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> bridges;
-
-    @Before
-    public void setUp() throws Exception {
-        contUpdateCmd = mock(ControllerUpdateCommand.class, Mockito.CALLS_REAL_METHODS);
-    }
-
-    @Test
-    public void testExecute() {
-        PowerMockito.mockStatic(TransactUtils.class);
-        when(TransactUtils.extractCreated(changes, ControllerEntry.class)).thenReturn(controllers);
-        when(TransactUtils.extractUpdated(changes, OvsdbBridgeAugmentation.class)).thenReturn(bridges);
-
-        TransactionBuilder transaction = mock(TransactionBuilder.class, Mockito.RETURNS_MOCKS);
-        contUpdateCmd.execute(transaction, mock(BridgeOperationalState.class), changes,
-                mock(InstanceIdentifierCodec.class));
-
-        // TODO Actually verify something
-    }
-
-}