Search in sources :

Example 1 with KildaConfigurationRepository

use of org.openkilda.persistence.repositories.KildaConfigurationRepository 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);
}
Also used : SwitchPropertiesRepository(org.openkilda.persistence.repositories.SwitchPropertiesRepository) Switch(org.openkilda.model.Switch) KildaConfigurationRepository(org.openkilda.persistence.repositories.KildaConfigurationRepository) SwitchRepository(org.openkilda.persistence.repositories.SwitchRepository) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 Switch (org.openkilda.model.Switch)1 KildaConfigurationRepository (org.openkilda.persistence.repositories.KildaConfigurationRepository)1 SwitchPropertiesRepository (org.openkilda.persistence.repositories.SwitchPropertiesRepository)1 SwitchRepository (org.openkilda.persistence.repositories.SwitchRepository)1