package com.net2plan.gui.plugins.networkDesign.viewEditTopolTables.controlTables;

import com.net2plan.gui.plugins.GUINetworkDesign;
import com.net2plan.gui.plugins.networkDesign.viewEditTopolTables.controlTables.specificTables.AdvancedJTable_forwardingRule;
import com.net2plan.interfaces.networkDesign.NetPlan;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import javax.swing.*;

/**
 * @author Jorge San Emeterio
 * @date 24/04/17
 */
public class AdvancedJTable_networkElementTest
{
    private static AdvancedJTable_networkElement table;

    private static GUINetworkDesign networkDesign;
    private static NetPlan netPlan;

    @Before
    public void setUp()
    {
        networkDesign = new GUINetworkDesign();
        networkDesign.configure(new JPanel());

        netPlan = new NetPlan();

        networkDesign.setDesign(netPlan);
        networkDesign.updateVisualizationAfterNewTopology();
    }

    @Test
    public void forwardingRuleNoAttributesTest()
    {
        table = new AdvancedJTable_forwardingRule(networkDesign);
        Assert.assertFalse(table.hasAttributes());
    }
}

@@ -263,53 +263,47 @@
 ort 
-com.net2plan.interfaces.networkDesign.NetPlan
+org.junit.Assert;%0Aimport org.junit.Test
 ;%0Aim
@@ -309,38 +309,46 @@
 mport org.junit.
-Assert
+runner.RunWith
 ;%0Aimport org.jun
@@ -348,20 +348,20 @@
 org.
-junit.Before
+mockito.Mock
 ;%0Aim
@@ -373,41 +373,81 @@
 org.
-junit.Test;%0A%0Aimport javax.swing.*
+mockito.junit.MockitoJUnitRunner;%0A%0Aimport static org.mockito.Mockito.mock
 ;%0A%0A/
@@ -501,16 +501,51 @@
 /17%0A */%0A
+@RunWith(MockitoJUnitRunner.class)%0A
 public c
@@ -642,24 +642,34 @@
 table;%0A%0A    
+@Mock%0A    
 private stat
@@ -674,147 +674,8 @@
 atic
- GUINetworkDesign networkDesign;%0A    private static NetPlan netPlan;%0A%0A    @Before%0A    public void setUp()%0A    %7B%0A        networkDesign = new
  GUI
@@ -691,19 +691,8 @@
 sign
-();%0A       
  net
@@ -705,177 +705,40 @@
 sign
-.configure(new JPanel());%0A%0A        netPlan = new NetPlan();%0A%0A        networkDesign.setDesign(netPlan);%0A        networkDesign.updateVisualizationAfterNewTopology();%0A    %7D
+ = mock(GUINetworkDesign.class);
 %0A%0A  

Clean test