1 | package fr.sii.ogham.email.sender.impl.javamail; | |
2 | ||
3 | import javax.mail.Authenticator; | |
4 | import javax.mail.PasswordAuthentication; | |
5 | ||
6 | /** | |
7 | * Basic authenticator that uses the provided username and password. | |
8 | * | |
9 | * @author Aurélien Baudet | |
10 | * | |
11 | */ | |
12 | public class UsernamePasswordAuthenticator extends Authenticator { | |
13 | /** | |
14 | * The username for authentication | |
15 | */ | |
16 | private String username; | |
17 | ||
18 | /** | |
19 | * The password for authentication | |
20 | */ | |
21 | private String password; | |
22 | ||
23 | public UsernamePasswordAuthenticator(String username, String password) { | |
24 | super(); | |
25 | this.username = username; | |
26 | this.password = password; | |
27 | } | |
28 | ||
29 | @Override | |
30 | protected PasswordAuthentication getPasswordAuthentication() { | |
31 |
2
1. getPasswordAuthentication : replaced return value with null for fr/sii/ogham/email/sender/impl/javamail/UsernamePasswordAuthenticator::getPasswordAuthentication → NO_COVERAGE 2. getPasswordAuthentication : replaced return value with null for fr/sii/ogham/email/sender/impl/javamail/UsernamePasswordAuthenticator::getPasswordAuthentication → KILLED |
return new PasswordAuthentication(username, password); |
32 | } | |
33 | } | |
Mutations | ||
31 |
1.1 2.2 |