@@ -0,0 +1,2658 @@
+/*%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.when;%0A%0Aimport java.net.HttpURLConnection;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport org.opendaylight.neutron.spi.NeutronSubnet;%0Aimport org.opendaylight.ovsdb.openstack.netvirt.api.Action;%0Aimport org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;%0A%0A/**%0A * Unit test fort %7B@link SubnetHandler%7D%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class SubnetHandlerTest %7B%0A%0A    @InjectMocks private SubnetHandler subnetHandler;%0A%0A    @Mock NeutronL3Adapter neutronl3Adapter;%0A%0A    @Test%0A    public void testCanCreateSubnet() %7B%0A        assertEquals(%22Error, canCreateSubnet() did not return the correct HTTP flag%22, HttpURLConnection.HTTP_CREATED, subnetHandler.canCreateSubnet(mock(NeutronSubnet.class)));%0A    %7D%0A%0A    @Test%0A    public void testCanUpdateSubnet() %7B%0A        assertEquals(%22Error, canUpdateSubnet() did not return the correct HTTP flag%22, HttpURLConnection.HTTP_CREATED, subnetHandler.canUpdateSubnet(mock(NeutronSubnet.class), mock(NeutronSubnet.class)));%0A    %7D%0A%0A    @Test%0A    public void testCanDeleteSubnet() %7B%0A        assertEquals(%22Error, canDeleteSubnet() did not return the correct HTTP flag%22, HttpURLConnection.HTTP_CREATED, subnetHandler.canDeleteSubnet(mock(NeutronSubnet.class)));%0A    %7D%0A%0A    @Test%0A    public void testProcessEvent() %7B%0A        NorthboundEvent ev = mock(NorthboundEvent.class);%0A        when(ev.getSubnet()).thenReturn(mock(NeutronSubnet.class));%0A%0A        when(ev.getAction()).thenReturn(Action.ADD);%0A        subnetHandler.processEvent(ev);%0A        verify(neutronl3Adapter, times(1)).handleNeutronSubnetEvent(ev.getSubnet(), ev.getAction());;%0A%0A        when(ev.getAction()).thenReturn(Action.DELETE);%0A        subnetHandler.processEvent(ev);%0A        verify(neutronl3Adapter, times(1)).handleNeutronSubnetEvent(ev.getSubnet(), ev.getAction());;%0A%0A        when(ev.getAction()).thenReturn(Action.UPDATE);%0A        subnetHandler.processEvent(ev);%0A        verify(neutronl3Adapter, times(1)).handleNeutronSubnetEvent(ev.getSubnet(), ev.getAction());;%0A    %7D%0A%7D%0A

Add JUnit testing for SubnetHandler class.