broker/FileAuthenticatorTest: code formatter used
This commit is contained in:
@@ -13,11 +13,11 @@
|
|||||||
*
|
*
|
||||||
* You may elect to redistribute this code under either of these licenses.
|
* You may elect to redistribute this code under either of these licenses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.moquette.spi.impl.security;
|
package io.moquette.spi.impl.security;
|
||||||
|
|
||||||
import io.moquette.spi.security.IAuthenticator;
|
import io.moquette.spi.security.IAuthenticator;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
@@ -26,28 +26,28 @@ import static org.junit.Assert.assertTrue;
|
|||||||
* @author andrea
|
* @author andrea
|
||||||
*/
|
*/
|
||||||
public class FileAuthenticatorTest {
|
public class FileAuthenticatorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loadPasswordFile_verifyValid() {
|
public void loadPasswordFile_verifyValid() {
|
||||||
String file = getClass().getResource("/password_file.conf").getPath();
|
String file = getClass().getResource("/password_file.conf").getPath();
|
||||||
IAuthenticator auth = new FileAuthenticator(null, file);
|
IAuthenticator auth = new FileAuthenticator(null, file);
|
||||||
|
|
||||||
assertTrue(auth.checkValid(null, "testuser", "passwd".getBytes()));
|
assertTrue(auth.checkValid(null, "testuser", "passwd".getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loadPasswordFile_verifyInvalid() {
|
public void loadPasswordFile_verifyInvalid() {
|
||||||
String file = getClass().getResource("/password_file.conf").getPath();
|
String file = getClass().getResource("/password_file.conf").getPath();
|
||||||
IAuthenticator auth = new FileAuthenticator(null, file);
|
IAuthenticator auth = new FileAuthenticator(null, file);
|
||||||
|
|
||||||
assertFalse(auth.checkValid(null, "testuser2", "passwd".getBytes()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void loadPasswordFile_verifyDirectoryRef() {
|
|
||||||
IAuthenticator auth = new FileAuthenticator("", "");
|
|
||||||
|
|
||||||
assertFalse(auth.checkValid(null, "testuser2", "passwd".getBytes()));
|
assertFalse(auth.checkValid(null, "testuser2", "passwd".getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@Test
|
||||||
|
public void loadPasswordFile_verifyDirectoryRef() {
|
||||||
|
IAuthenticator auth = new FileAuthenticator("", "");
|
||||||
|
|
||||||
|
assertFalse(auth.checkValid(null, "testuser2", "passwd".getBytes()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user