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);
}
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));
}
Aggregations