@@ -0,0 +1,2890 @@
+/*%0A * Copyright (c) 2015 Inocybe and others.  All rights reserved.%0A *%0A * This program and the accompanying materials are made available under the%0A * terms of the Eclipse Public License v1.0 which accompanies this distribution,%0A * and is available at http://www.eclipse.org/legal/epl-v10.html%0A */%0A%0Apackage org.opendaylight.ovsdb.openstack.netvirt;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.verifyNoMoreInteractions;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.net.HttpURLConnection;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport org.opendaylight.neutron.spi.NeutronFloatingIP;%0Aimport org.opendaylight.ovsdb.openstack.netvirt.api.Action;%0Aimport org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;%0A%0A/**%0A * Unit test for %7B@link FloatingIPHandler%7D%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class FloatingIPHandlerTest %7B%0A%0A    @InjectMocks private FloatingIPHandler floatingHandler = mock(FloatingIPHandler.class, Mockito.CALLS_REAL_METHODS);%0A    @InjectMocks private NeutronL3Adapter neutronL3Adapter = mock(NeutronL3Adapter.class);%0A%0A    @Test%0A    public void testCanCreateFloatingIP()%7B%0A        assertEquals(%22Error, did not return the correct HTTP status code%22, HttpURLConnection.HTTP_OK, floatingHandler.canCreateFloatingIP(mock(NeutronFloatingIP.class)));%0A    %7D%0A%0A    @Test%0A    public void testCanUpdateFloatingIP()%7B%0A        assertEquals(%22Error, did not return the correct HTTP status code%22, HttpURLConnection.HTTP_OK, floatingHandler.canUpdateFloatingIP(mock(NeutronFloatingIP.class), mock(NeutronFloatingIP.class)));%0A    %7D%0A%0A    @Test%0A    public void testCanDeleteFloatingIP()%7B%0A        assertEquals(%22Error, did not return the correct HTTP status code%22, HttpURLConnection.HTTP_OK, floatingHandler.canDeleteFloatingIP(mock(NeutronFloatingIP.class)));%0A    %7D%0A%0A    @Test%0A    public void testProcessEvent()%7B%0A        NorthboundEvent ev = mock(NorthboundEvent.class);%0A%0A        when(ev.getNeutronFloatingIP()).thenReturn(mock(NeutronFloatingIP.class));%0A        when(ev.getAction()).thenReturn(Action.UPDATE);%0A%0A        verifyNoMoreInteractions(neutronL3Adapter);%0A%0A        floatingHandler.processEvent((AbstractEvent) ev);%0A%0A        verify(neutronL3Adapter, times(1)).handleNeutronFloatingIPEvent(ev.getNeutronFloatingIP(), ev.getAction());;%0A%0A        when(ev.getAction()).thenReturn(Action.ADD);%0A        verify(neutronL3Adapter, times(0)).handleNeutronFloatingIPEvent(ev.getNeutronFloatingIP(), ev.getAction());;%0A%0A        when(ev.getAction()).thenReturn(Action.DELETE);%0A        verify(neutronL3Adapter, times(0)).handleNeutronFloatingIPEvent(ev.getNeutronFloatingIP(), ev.getAction());;%0A    %7D%0A%7D%0A

Add JUnit testing for FloatingIPHandler class.