use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder in project lispflowmapping by opendaylight.
the class LispUtil method buildAddKeyInput.
public static AddKeyInput buildAddKeyInput(Eid eid, String net) {
AddKeyInputBuilder kib = new AddKeyInputBuilder();
kib.setEid(eid).setMappingAuthkey(new MappingAuthkeyBuilder().setKeyString(net).setKeyType(1).build());
return kib.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder in project lispflowmapping by opendaylight.
the class SubnetDataProcessorTest method createTest.
/**
* Tests {@link SubnetDataProcessor#create} method.
*/
@Test
public void createTest() throws ExecutionException, InterruptedException {
final MappingAuthkey mappingAuthkey = new MappingAuthkeyBuilder().setKeyString(UUID_STRING).setKeyType(1).build();
final AddKeyInput addKeyInput = new AddKeyInputBuilder().setEid(EID).setMappingAuthkey(mappingAuthkey).build();
commonStubbing();
Mockito.when(odlMappingserviceServiceMock.addKey(addKeyInput)).thenReturn(future);
subnetDataProcessor.create(subnet);
assertEquals(true, rpcResult.isSuccessful());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder in project lispflowmapping by opendaylight.
the class MappingServiceShell method addDefaultKeyIPv6.
@Override
public void addDefaultKeyIPv6() {
Eid eid = LispAddressUtil.toEid(new Ipv6Prefix("::0/0"), null);
MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build();
mappingService.addAuthenticationKey(eid, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder in project lispflowmapping by opendaylight.
the class MappingServiceShell method addDefaultKeyIPv4.
@Override
public void addDefaultKeyIPv4() {
Eid eid = LispAddressUtil.toEid(new Ipv4Prefix("0.0.0.0/0"), null);
MappingAuthkey key = new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build();
mappingService.addAuthenticationKey(eid, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkeyBuilder in project lispflowmapping by opendaylight.
the class LispSouthboundHandlerTest method initTests.
@SuppressWarnings("unchecked")
@BeforeClass
public static void initTests() {
akdb = Mockito.mock(AuthKeyDb.class);
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv4PrefixBinaryEid("10.10.10.10/8")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv6PrefixBinaryEid("2610:d0:ffff:192:0:0:0:1/128")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv4PrefixBinaryEid("153.16.254.1/32")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv4PrefixBinaryEid("125.124.123.122/8", new InstanceIdType(21L))))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asMacEid("0a:0b:0c:0d:0e:0f")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv6PrefixBinaryEid("f0f:f0f:f0f:f0f:f0f:f0f:f0f:f0f/8")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
Mockito.when(akdb.getAuthenticationKey(Matchers.eq(LispAddressUtil.asIpv4PrefixBinaryEid("172.1.1.2/32")))).thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
akdl = Mockito.mock(AuthenticationKeyDataListener.class);
Mockito.when(akdl.authKeysForEidsUnchanged(Mockito.anyList(), Mockito.anyLong())).thenReturn(true);
}
Aggregations