use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingKey in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method addMappingTest.
/**
* Tests {@link DataStoreBackEnd#addMapping} method.
*/
@Test
public void addMappingTest() {
final Mapping mapping = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().build()).setOrigin(MappingOrigin.Northbound).build();
dataStoreBackEnd.addMapping(mapping);
Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorMapping.capture(), Mockito.eq(mapping), Mockito.eq(true));
// result
MappingKey result = iidCaptorMapping.getValue().firstKeyOf(Mapping.class);
assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
assertEquals(MappingOrigin.Northbound, result.getOrigin());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.MappingKey in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method updateMappingTest.
/**
* Tests {@link DataStoreBackEnd#updateMapping} method.
*/
@Test
public void updateMappingTest() {
final Mapping mapping = new MappingBuilder().setMappingRecord(getDefaultMappingRecordBuilder().build()).setOrigin(MappingOrigin.Northbound).build();
dataStoreBackEnd.updateMapping(mapping);
Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorMapping.capture(), Mockito.eq(mapping), Mockito.eq(true));
// result
MappingKey result = iidCaptorMapping.getValue().firstKeyOf(Mapping.class);
assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
assertEquals(MappingOrigin.Northbound, result.getOrigin());
}
Aggregations