Search in sources :

Example 6 with SwitchValidateRequest

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());
}
Also used : ValidateRulesResult(org.openkilda.wfm.topology.switchmanager.model.ValidateRulesResult) MeterInfoEntry(org.openkilda.messaging.info.switches.MeterInfoEntry) ValidateMetersResult(org.openkilda.wfm.topology.switchmanager.model.ValidateMetersResult) SwitchValidateRequest(org.openkilda.messaging.command.switches.SwitchValidateRequest) ValidationResult(org.openkilda.wfm.topology.switchmanager.model.ValidationResult) Test(org.junit.Test)

Aggregations

SwitchValidateRequest (org.openkilda.messaging.command.switches.SwitchValidateRequest)6 Values (org.apache.storm.tuple.Values)3 Test (org.junit.Test)2 MeterInfoEntry (org.openkilda.messaging.info.switches.MeterInfoEntry)2 ValidateMetersResult (org.openkilda.wfm.topology.switchmanager.model.ValidateMetersResult)2 ValidationResult (org.openkilda.wfm.topology.switchmanager.model.ValidationResult)2 Message (org.openkilda.messaging.Message)1 MessageData (org.openkilda.messaging.MessageData)1 CommandData (org.openkilda.messaging.command.CommandData)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 FlowRerouteRequest (org.openkilda.messaging.command.flow.FlowRerouteRequest)1 SwitchRulesDeleteRequest (org.openkilda.messaging.command.switches.SwitchRulesDeleteRequest)1 SwitchRulesInstallRequest (org.openkilda.messaging.command.switches.SwitchRulesInstallRequest)1 ErrorData (org.openkilda.messaging.error.ErrorData)1 CreateLagPortRequest (org.openkilda.messaging.swmanager.request.CreateLagPortRequest)1 DeleteLagPortRequest (org.openkilda.messaging.swmanager.request.DeleteLagPortRequest)1 CommandContext (org.openkilda.wfm.CommandContext)1 ValidateRulesResult (org.openkilda.wfm.topology.switchmanager.model.ValidateRulesResult)1