use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.Nanotime in project bgpcep by opendaylight.
the class ProgrammingServiceImplTest method getMockedSubmitInstructionInput.
private static SubmitInstructionInput getMockedSubmitInstructionInput(final String id, final Optional<Nanotime> deadline, final String... dependencyIds) {
final SubmitInstructionInput mockedSubmitInstruction = mock(SubmitInstructionInput.class);
doReturn(PcepUpdateTunnelInput.class).when(mockedSubmitInstruction).getImplementedInterface();
final List<InstructionId> dependencies = Lists.newArrayList();
for (final String dependencyId : dependencyIds) {
dependencies.add(new InstructionId(dependencyId));
}
doReturn(dependencies).when(mockedSubmitInstruction).getPreconditions();
doReturn(new InstructionId(id)).when(mockedSubmitInstruction).getId();
doReturn(deadline.isPresent() ? deadline.get() : new Nanotime(BigInteger.valueOf(Long.MAX_VALUE))).when(mockedSubmitInstruction).getDeadline();
return mockedSubmitInstruction;
}
Aggregations