use of org.openkilda.messaging.command.switches.SwitchValidateRequest in project open-kilda by telstra.
the class SwitchSyncFsmTest method getModifyDefaultMetersWithMissingRulesTest.
@Test
public void getModifyDefaultMetersWithMissingRulesTest() {
ValidateRulesResult validateRulesResult = new ValidateRulesResult(newHashSet(COOKIE_1), newHashSet(), newHashSet(), newHashSet(COOKIE_2));
ArrayList<MeterInfoEntry> misconfiguredMeters = newArrayList(MeterInfoEntry.builder().cookie(COOKIE_1).meterId(METER_ID_1).build(), MeterInfoEntry.builder().cookie(COOKIE_2).meterId(METER_ID_2).build(), MeterInfoEntry.builder().cookie(COOKIE_3).meterId(METER_ID_3).build());
ValidateMetersResult validateMetersResult = new ValidateMetersResult(newArrayList(), misconfiguredMeters, newArrayList(), newArrayList());
ValidationResult validationResult = new ValidationResult(new ArrayList<>(), true, validateRulesResult, validateMetersResult, EMPTY_VALIDATE_GROUPS_RESULT, EMPTY_LOGICAL_PORTS_RESULT);
SwitchSyncFsm fsm = new SwitchSyncFsm(null, null, null, new SwitchValidateRequest(SWITCH_ID, true, true, true), validationResult);
List<Long> modifyMeters = fsm.getModifyDefaultMeters();
assertEquals(1, modifyMeters.size());
assertEquals(METER_ID_3, modifyMeters.get(0).longValue());
}
Aggregations