use of org.openkilda.persistence.repositories.SwitchPropertiesRepository in project open-kilda by telstra.
the class FlowPathBuilderTest method setUp.
@Before
public void setUp() {
SwitchRepository switchRepository = mock(SwitchRepository.class);
SwitchPropertiesRepository switchPropertiesRepository = mock(SwitchPropertiesRepository.class);
KildaConfigurationRepository kildaConfigurationRepository = mock(KildaConfigurationRepository.class);
when(switchRepository.findById(any())).thenAnswer(invocation -> Optional.of(Switch.builder().switchId(invocation.getArgument(0)).build()));
when(switchPropertiesRepository.findBySwitchId(any())).thenAnswer(invocation -> {
Switch sw = Switch.builder().switchId(invocation.getArgument(0)).build();
return Optional.of(SwitchProperties.builder().switchObj(sw).multiTable(false).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build());
});
builder = new FlowPathBuilder(switchPropertiesRepository, kildaConfigurationRepository);
}
Aggregations