mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
18.07.2015 12410b057cb46a1cc781a3f6900c192f5688a7f4
Checkstyle, the love of my life
1 files modified
26 ■■■■■ changed files
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AuthPasswordSyntaxImplTest.java 26 ●●●●● patch | view | raw | blame | history
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/AuthPasswordSyntaxImplTest.java
@@ -33,13 +33,13 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/** Tests the AuthPasswordSyntax. */
/** Tests the AuthPasswordSyntaxImpl. */
@Test
@SuppressWarnings("javadoc")
public class AuthPasswordSyntaxImplTest extends ForgeRockTestCase
{
public class AuthPasswordSyntaxImplTest extends ForgeRockTestCase {
  @DataProvider
  public Object[][] validEncodedPasswords()
  {
    public Object[][] validEncodedPasswords() {
    return new Object[][] {
        { "0$0$0", "0", "0", "0" },
        { " 0$0$0", "0", "0", "0" },
@@ -53,15 +53,13 @@
  @Test(dataProvider = "validEncodedPasswords")
  public void decodeValidPassword(String encodedPassword, String expectedScheme, String expectedAuthInfo,
      String expectedAuthValue) throws Exception
  {
            String expectedAuthValue) throws Exception {
    assertThat(AuthPasswordSyntaxImpl.decodeAuthPassword(encodedPassword))
        .isEqualTo(new String[] {expectedScheme, expectedAuthInfo, expectedAuthValue} );
  }
  @DataProvider
  public Object[][] invalidEncodedPasswords()
  {
    public Object[][] invalidEncodedPasswords() {
    return new Object[][] {
        { "", "zero-length scheme element" },
        { "$", "zero-length scheme element" },
@@ -77,15 +75,11 @@
  }
  @Test(dataProvider = "invalidEncodedPasswords")
  public void decodeInvalidPassword(String encodedPassword  , String errorMsg  ) throws Exception
  {
    try
    {
    public void decodeInvalidPassword(String encodedPassword, String errorMsg) throws Exception {
        try {
      AuthPasswordSyntaxImpl.decodeAuthPassword(encodedPassword);
      Assert.fail("Expected DirectoryException");
    }
    catch (DecodeException e)
    {
        } catch (DecodeException e) {
      assertThat(e.getMessage()).contains(errorMsg);
    }
  }