import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Matchers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.flow.capable.node.connector.queue.statistics.FlowCapableNodeConnectorQueueStatisticsBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-/**
- *
- */
public class QueueStatNotificationSupplierImplTest {
private static final String FLOW_NODE_ID = "openflow:111";
@Test
public void testCreate() {
- final QueueStatisticsUpdate notification = notifSupplierImpl.createNotification(createTestQueueStat(),
- createTestQueueStatPath());
+ final QueueStatisticsUpdate notification = notifSupplierImpl
+ .createNotification(createTestQueueStat(), createTestQueueStatPath());
assertNotNull(notification);
assertEquals(FLOW_NODE_ID, notification.getId().getValue());
assertEquals(FLOW_CODE_CONNECTOR_ID, notification.getNodeConnector().get(0).getId().getValue());
@Test
public void testCreateChangeEvent() {
- final TestData testData = new TestData(createTestQueueStatPath(),null,createTestQueueStat(),
- DataObjectModification.ModificationType.WRITE);
+ final TestData testData = new TestData(createTestQueueStatPath(), null, createTestQueueStat(),
+ DataObjectModification.ModificationType.WRITE);
Collection<DataTreeModification<FlowCapableNodeConnectorQueueStatisticsData>> collection = new ArrayList<>();
collection.add(testData);
notifSupplierImpl.onDataTreeChanged(collection);
- verify(notifProviderService, times(1)).publish(Matchers.any(QueueStatisticsUpdate.class));
+ verify(notifProviderService, times(1)).publish(any(QueueStatisticsUpdate.class));
}
@Test(expected = IllegalArgumentException.class)
}
private static FlowCapableNodeConnectorQueueStatisticsData createTestQueueStat() {
- final FlowCapableNodeConnectorQueueStatisticsDataBuilder builder = new FlowCapableNodeConnectorQueueStatisticsDataBuilder();
- final FlowCapableNodeConnectorQueueStatisticsBuilder value = new FlowCapableNodeConnectorQueueStatisticsBuilder();
+ final FlowCapableNodeConnectorQueueStatisticsDataBuilder builder
+ = new FlowCapableNodeConnectorQueueStatisticsDataBuilder();
+ final FlowCapableNodeConnectorQueueStatisticsBuilder value
+ = new FlowCapableNodeConnectorQueueStatisticsBuilder();
builder.setFlowCapableNodeConnectorQueueStatistics(value.build());
return builder.build();
}
-}
-
+}
\ No newline at end of file