use of org.openkilda.model.Isl in project open-kilda by telstra.
the class FermaIslRepositoryTest method shouldDeleteFoundIsl.
@Test
public void shouldDeleteFoundIsl() {
Isl isl1 = createIsl(switchA, 1, switchB, 1);
createIsl(switchA, 2, switchB, 2);
assertThat(islRepository.findAll(), Matchers.hasSize(2));
transactionManager.doInTransaction(() -> islRepository.remove(isl1));
assertThat(islRepository.findAll(), Matchers.hasSize(1));
}
use of org.openkilda.model.Isl in project open-kilda by telstra.
the class FermaIslRepositoryTest method shouldFindAllIsls.
@Test
public void shouldFindAllIsls() {
Isl isl1 = createIsl(switchA, 111, switchB, 121, IslStatus.ACTIVE);
Isl isl2 = createIsl(switchA, 112, switchB, 122, IslStatus.INACTIVE);
Isl isl3 = createIsl(switchA, 113, switchB, 123, IslStatus.MOVED);
List<Isl> foundIsls = Lists.newArrayList(islRepository.findAll());
assertThat(foundIsls, Matchers.hasSize(3));
assertThat(foundIsls, Matchers.containsInAnyOrder(isl1, isl2, isl3));
}
use of org.openkilda.model.Isl in project open-kilda by telstra.
the class FermaIslRepositoryTest method shouldFindIslByDestSwitch.
@Test
public void shouldFindIslByDestSwitch() {
Isl isl1 = createIsl(switchA, 111, switchB, 121);
Isl isl2 = createIsl(switchA, 112, switchB, 122);
List<Isl> foundIsls = Lists.newArrayList(islRepository.findByDestSwitch(TEST_SWITCH_B_ID));
assertThat(foundIsls, Matchers.hasSize(2));
assertThat(foundIsls, Matchers.containsInAnyOrder(isl1, isl2));
}
use of org.openkilda.model.Isl in project open-kilda by telstra.
the class FermaIslRepositoryTest method shouldCreateAndFindIslByEndpoint.
@Test
public void shouldCreateAndFindIslByEndpoint() {
Isl isl = createIsl(switchA, 1, switchB, 1);
assertThat(islRepository.findAll(), Matchers.hasSize(1));
List<Isl> foundIsls = Lists.newArrayList(islRepository.findBySrcEndpoint(TEST_SWITCH_A_ID, 1));
assertThat(foundIsls, Matchers.hasSize(1));
assertThat(foundIsls, Matchers.contains(isl));
}
use of org.openkilda.model.Isl in project open-kilda by telstra.
the class FermaIslRepositoryTest method shouldFindIslByDestEndpoint.
@Test
public void shouldFindIslByDestEndpoint() {
Isl isl = createIsl(switchA, 111, switchB, 112);
List<Isl> foundIsls = Lists.newArrayList(islRepository.findByDestEndpoint(TEST_SWITCH_B_ID, 112));
assertThat(foundIsls, Matchers.hasSize(1));
assertThat(foundIsls, Matchers.contains(isl));
}
Aggregations