1 package org.openkilda.topo.builders;
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertTrue;
5 import static org.junit.Assert.fail;
17 +
"{\"name\":\"sw1\", \"outgoing_relationships\": [\"sw2\"]}, " 18 +
"{\"name\":\"sw2\", \"outgoing_relationships\": []}" 21 assertEquals(
"Expected 2 switches to be parsed", 2,
result.getSwitches().size());
22 assertEquals(
"Expected 1 link to be parsed", 1,
result.getLinks().size());
23 assertTrue(
"Expected 'sw1' switch to be parsed",
result.getSwitches().containsKey(
"SW1"));
24 assertTrue(
"Expected 'sw2' switch to be parsed",
result.getSwitches().containsKey(
"SW2"));
25 Link link =
result.getLinks().values().iterator().next();
26 assertEquals(
"Expected a link from sw1 to be parsed",
"SW1", link.getSrc().getTopoSwitch().getId());
27 assertEquals(
"Expected a link to sw2 to be parsed",
"SW2", link.getDst().getTopoSwitch().getId());
33 +
"{\"name\":\"sw1\"}, " 34 +
"{\"name\":\"sw2\"}" 37 assertEquals(
"Expected 2 switches to be parsed", 2,
result.getSwitches().size());
38 assertEquals(
"Expected 0 link to be parsed", 0,
result.getLinks().size());
44 +
"{\"outgoing_relationships\": [\"sw2\"]}, " 45 +
"{\"name\":\"sw2\", \"outgoing_relationships\": []}" 54 +
"{\"name\":\"\", \"outgoing_relationships\": [\"sw2\"]}, " 55 +
"{\"name\":\"sw2\", \"outgoing_relationships\": []}"
void shouldFailIfNodeHasNoName()
void shouldParseJsonWithoutRelations()
void shouldFailIfNodeHasEmptyName()
static Topology parseTopologyEngineJson(String json)