use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInputBuilder in project bgpcep by opendaylight.
the class ProgrammingServiceImplTest method testCleanInstructions.
@Test
public void testCleanInstructions() throws Exception {
final SubmitInstructionInput mockedSubmit1 = getMockedSubmitInstructionInput("mockedSubmit1");
this.testedProgrammingService.scheduleInstruction(mockedSubmit1);
final SubmitInstructionInput mockedSubmit2 = getMockedSubmitInstructionInput("mockedSubmit2", "mockedSubmit1");
this.testedProgrammingService.scheduleInstruction(mockedSubmit2);
final CleanInstructionsInputBuilder cleanInstructionsInputBuilder = new CleanInstructionsInputBuilder();
final CleanInstructionsInput cleanInstructionsInput = cleanInstructionsInputBuilder.setId(Lists.newArrayList(mockedSubmit1.getId(), mockedSubmit2.getId())).build();
ListenableFuture<RpcResult<CleanInstructionsOutput>> cleanedInstructionOutput = this.testedProgrammingService.cleanInstructions(cleanInstructionsInput);
assertCleanInstructionOutput(cleanedInstructionOutput, 2);
this.testedProgrammingService.cancelInstruction(getCancelInstruction("mockedSubmit1"));
cleanedInstructionOutput = this.testedProgrammingService.cleanInstructions(cleanInstructionsInput);
assertCleanInstructionOutput(cleanedInstructionOutput, 0);
checkNotPresentOperational(getDataBroker(), buildInstructionIID(mockedSubmit1.getId()));
checkNotPresentOperational(getDataBroker(), buildInstructionIID(mockedSubmit2.getId()));
}
Aggregations