Package edu.wpi.cs.wpisuitetng.modules.core.models

Examples of edu.wpi.cs.wpisuitetng.modules.core.models.User.matchPassword()


    assertEquals(2, inflated.getIdNum());
    assertTrue(inflated.getName().equals("Tyler"));
    assertTrue(inflated.getUsername().equals("twack"));
    assertTrue(inflated.getRole().equals(Role.ADMIN));
   
    assertTrue(inflated.matchPassword("abcde"));
    assertFalse(inflated.matchPassword(null));
  }
 
  @Test
  /**
 
View Full Code Here


    assertTrue(inflated.getName().equals("Tyler"));
    assertTrue(inflated.getUsername().equals("twack"));
    assertTrue(inflated.getRole().equals(Role.ADMIN));
   
    assertTrue(inflated.matchPassword("abcde"));
    assertFalse(inflated.matchPassword(null));
  }
 
  @Test
  /**
   * Tests User deserialization when the given string is missing fields (but has the unique identifier idNum)
View Full Code Here

    User inflated = deserializer.fromJson(jsonUser, User.class);
   
    assertEquals(2, inflated.getIdNum());
    assertTrue(inflated.getUsername().equals("Tyler"));
   
    assertFalse(inflated.matchPassword(null));
  }
 
  @Test(expected=JsonParseException.class)
  /**
   * Tests error handling in the deserializer -- an exception should be thrown if
View Full Code Here

    // check password
    System.out.println("DEBUG: Authenticate Password");
    // password security
    logger.log(Level.INFO, "Authenticating password for User <" + credentials[0] + ">...");
    String hashedPassword = this.passwordHash.generateHash(credentials[1]);
    if(!user.matchPassword(hashedPassword))
    {
      logger.log(Level.WARNING, "Login attempted with bad password for User <" + credentials[0] + ">");
      throw new AuthenticationException("An invalid password was given. Please check the password and try again.");
    }
    logger.log(Level.INFO, "Password authentication Success! <" + credentials[0] + ">");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.