<groupId>org.opendaylight.controller.model</groupId>
<artifactId>model-inventory</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>messagebus-netconf</artifactId>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netconf-config-dispatcher</artifactId>
<type>xml</type>
<classifier>config</classifier>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>messagebus-netconf</artifactId>
+ <version>${netconf.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
<!--
Optional TODO: Remove TODO comments.
<groupId>org.opendaylight.controller</groupId>
<artifactId>opendaylight-karaf-empty</artifactId>
<version>${commons.opendaylight.version}</version>
+ <scope>test</scope>
<type>zip</type>
</dependency>
<!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
<groupId>org.opendaylight.controller</groupId>
<artifactId>opendaylight-karaf-empty</artifactId>
<version>${commons.opendaylight.version}</version>
+ <scope>test</scope>
<type>zip</type>
</dependency>
</dependencies>
<groupId>org.opendaylight.controller</groupId>
<artifactId>opendaylight-karaf-empty</artifactId>
<version>${commons.opendaylight.version}</version>
+ <scope>test</scope>
<type>zip</type>
</dependency>
<!-- Uncomment this if you get an error : java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
*/
public static volatile Map.Entry<BundleContext, CredentialServiceAuthProvider> INSTANCE;
- // TODO what domain should be used for this ? can we leave null ?
- public static final String DOMAIN = null;
-
// FIXME CredentialAuth is generic and it causes warnings during compilation
// Maybe there should be a PasswordCredentialAuth implements CredentialAuth<PasswordCredentials>
private volatile CredentialAuth<PasswordCredentials> nullableCredService;
Claim claim;
try {
- claim = nullableCredService.authenticate(new PasswordCredentialsWrapper(username, password), DOMAIN);
+ claim = nullableCredService.authenticate(new PasswordCredentialsWrapper(username, password));
} catch (AuthenticationException e) {
logger.debug("Authentication failed for user '{}' : {}", username, e);
return false;
public String password() {
return password;
}
+
+ @Override
+ public String domain() {
+ // If this is left null, default "sdn" domain is assumed
+ return null;
+ }
}
}
Claim claim = mock(Claim.class);
doReturn("domain").when(claim).domain();
- doReturn(claim).when(credAuth).authenticate(any(PasswordCredentials.class), anyString());
+ doReturn(claim).when(credAuth).authenticate(any(PasswordCredentials.class));
doReturn(credAuth).when(ctx).getService(serviceRef);
CredentialServiceAuthProvider credentialServiceAuthProvider = new CredentialServiceAuthProvider(ctx);
ServiceListenerAnswer answer = new ServiceListenerAnswer();
doAnswer(answer).when(ctx).addServiceListener(any(ServiceListener.class), anyString());
- doThrow(AuthenticationException.class).when(credAuth).authenticate(any(PasswordCredentials.class), anyString());
+ doThrow(AuthenticationException.class).when(credAuth).authenticate(any(PasswordCredentials.class));
doReturn(credAuth).when(ctx).getService(serviceRef);
CredentialServiceAuthProvider credentialServiceAuthProvider = new CredentialServiceAuthProvider(ctx);