use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey in project lispflowmapping by opendaylight.
the class InstanceIdentifierUtil method createAuthenticationKeyIid.
public static InstanceIdentifier<AuthenticationKey> createAuthenticationKeyIid(Eid eid) {
Preconditions.checkNotNull(eid, "Key needs and EID entry!");
VirtualNetworkIdentifierKey vniKey = new VirtualNetworkIdentifierKey(new VniUri(Long.toString(getLispInstanceId(eid))));
AuthenticationKeyKey authKeyKey = new AuthenticationKeyKey(new EidUri(LispAddressStringifier.getURIString(eid)));
return InstanceIdentifier.create(MappingDatabase.class).child(VirtualNetworkIdentifier.class, vniKey).child(AuthenticationKey.class, authKeyKey);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method addAuthenticationKeyTest.
/**
* Tests {@link DataStoreBackEnd#addAuthenticationKey} method.
*/
@Test
public void addAuthenticationKeyTest() {
final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
dataStoreBackEnd.addAuthenticationKey(authenticationKey);
Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey), Mockito.eq(true));
// result
AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey in project lispflowmapping by opendaylight.
the class DataStoreBackEndTest method removeAuthenticationKeyTest.
/**
* Tests {@link DataStoreBackEnd#removeAuthenticationKey} method.
*/
@Test
public void removeAuthenticationKeyTest() {
final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
dataStoreBackEnd.removeAuthenticationKey(authenticationKey);
Mockito.verify(wTxMock).delete(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture());
// result
AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
assertEquals("ipv4:" + IPV4_STRING_1, result.getEidUri().getValue());
}
Aggregations