@Test
public void testToDto() throws Exception {

    Network network = new Network();
    network.setNetworkName(NETWORK_NAME);
    Set<SubNetwork> subNets = new HashSet<SubNetwork>();
    SubNetwork subnet = new SubNetwork(SUBNETWORK_NAME, VDC, REGION);
    subNets.add(subnet);
    network.setSubNets(subNets);
    SubNetwork subnet2 = new SubNetwork(SUBNETWORK_NAME + 2, VDC, REGION);
    network.addSubNet(subnet2);
    NetworkDto netDto = network.toDto();
    assertEquals(netDto.getNetworkName(), NETWORK_NAME);
    assertEquals(netDto.getSubNetworkDto().size(), 2);
}