use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testScenarioMultiplePortDataAndThenRloc.
@Test
public void testScenarioMultiplePortDataAndThenRloc() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addPortData1(hostInformationManager);
addPortData2(hostInformationManager);
Mockito.verify(lfmDbService, Mockito.times(0)).addMapping(Mockito.any(AddMappingInput.class));
addRlocData(hostInformationManager);
AddMappingInput desiredMappingRecord1 = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_1);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord1);
AddMappingInput desiredMappingRecord2 = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_2);
Mockito.verify(lfmDbService).addMapping(desiredMappingRecord2);
destroySingleton(hostInformationManager);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class HostInformationManagerTest method testProperMappingRecordRemoval.
@Test
public void testProperMappingRecordRemoval() {
HostInformationManager hostInformationManager = getDefaultHostInformationManager();
addPortData1(hostInformationManager);
addRlocData(hostInformationManager);
addUpdatedPortData1(hostInformationManager);
RemoveMappingInput removeMappingInput = LispUtil.buildRemoveMappingInput(PORT_DATA_1.getPortEid());
Mockito.verify(lfmDbService).removeMapping(removeMappingInput);
AddMappingInput addMappingInput = createAddMappingInput(SAMPLE_RLOC, SAMPLE_EID_3);
Mockito.verify(lfmDbService).addMapping(addMappingInput);
destroySingleton(hostInformationManager);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.AddMappingInput in project lispflowmapping by opendaylight.
the class MappingServiceTest method addMappingTest.
/**
* Tests {@link MappingService#addMapping} method.
*/
@Test
public void addMappingTest() throws ExecutionException, InterruptedException {
final MappingRecordBuilder mappingRecordBuilder = getDefaultMappingRecordBuilder();
final AddMappingInput addMappingInput = new AddMappingInputBuilder().setMappingRecord(mappingRecordBuilder.build()).build();
final Future<RpcResult<Void>> result = mappingService.addMapping(addMappingInput);
Mockito.verify(dsbe).addMapping(RPCInputConvertorUtil.toMapping(addMappingInput));
assertEquals(RPC_RESULT_SUCCESS.getErrors(), result.get().getErrors());
assertEquals(RPC_RESULT_SUCCESS.getResult(), result.get().getResult());
assertEquals(RPC_RESULT_SUCCESS.isSuccessful(), result.get().isSuccessful());
}
Aggregations