Search in sources :

Example 1 with SwitchValidationResult

use of org.openkilda.northbound.dto.v1.switches.SwitchValidationResult in project open-kilda by telstra.

the class NorthboundServiceImpl method validateSwitch.

@Override
public SwitchValidationExtendedResult validateSwitch(SwitchId switchId) {
    log.debug("Switch validating '{}'", switchId);
    SwitchValidationResult result = Objects.requireNonNull(restTemplate.exchange("/api/v1/switches/{switch_id}/validate", HttpMethod.GET, new HttpEntity(buildHeadersWithCorrelationId()), SwitchValidationResult.class, switchId).getBody());
    return new SwitchValidationExtendedResult(switchId, result);
}
Also used : HttpEntity(org.springframework.http.HttpEntity) SwitchValidationExtendedResult(org.openkilda.testing.service.northbound.payloads.SwitchValidationExtendedResult) SwitchValidationResult(org.openkilda.northbound.dto.v1.switches.SwitchValidationResult)

Example 2 with SwitchValidationResult

use of org.openkilda.northbound.dto.v1.switches.SwitchValidationResult in project open-kilda by telstra.

the class JsonSerializationTest method switchValidateResultTest.

@Test
public void switchValidateResultTest() throws IOException {
    RulesValidationDto rules = new RulesValidationDto(singletonList(0L), singletonList(1L), singletonList(2L), singletonList(3L));
    MetersValidationDto meters = new MetersValidationDto(emptyList(), emptyList(), emptyList(), emptyList());
    GroupsValidationDto groups = new GroupsValidationDto(emptyList(), emptyList(), emptyList(), emptyList());
    LogicalPortsValidationDto logicalPorts = new LogicalPortsValidationDto(emptyList(), emptyList(), emptyList(), emptyList());
    SwitchValidationResult dto = new SwitchValidationResult(rules, meters, groups, logicalPorts);
    assertEquals(dto, pass(dto, SwitchValidationResult.class));
}
Also used : GroupsValidationDto(org.openkilda.northbound.dto.v1.switches.GroupsValidationDto) MetersValidationDto(org.openkilda.northbound.dto.v1.switches.MetersValidationDto) LogicalPortsValidationDto(org.openkilda.northbound.dto.v1.switches.LogicalPortsValidationDto) SwitchValidationResult(org.openkilda.northbound.dto.v1.switches.SwitchValidationResult) RulesValidationDto(org.openkilda.northbound.dto.v1.switches.RulesValidationDto) Test(org.junit.Test)

Aggregations

SwitchValidationResult (org.openkilda.northbound.dto.v1.switches.SwitchValidationResult)2 Test (org.junit.Test)1 GroupsValidationDto (org.openkilda.northbound.dto.v1.switches.GroupsValidationDto)1 LogicalPortsValidationDto (org.openkilda.northbound.dto.v1.switches.LogicalPortsValidationDto)1 MetersValidationDto (org.openkilda.northbound.dto.v1.switches.MetersValidationDto)1 RulesValidationDto (org.openkilda.northbound.dto.v1.switches.RulesValidationDto)1 SwitchValidationExtendedResult (org.openkilda.testing.service.northbound.payloads.SwitchValidationExtendedResult)1 HttpEntity (org.springframework.http.HttpEntity)1