/**
* Tests forgetting the password from given context.
*/
public void testForget()
{
IPasswordsRepository repository = initModernDatabase();
repository.record(SAMPLE_CONTEXT_A, SAMPLE_AUTH_INFO);
repository.record(SAMPLE_CONTEXT_B, SAMPLE_AUTH_INFO);
repository.forget(SAMPLE_CONTEXT_A);
PasswordAuthentication auth = repository.getAuthInformation(SAMPLE_CONTEXT_A);
assertNull("Database should forget about the context.", auth);
auth = repository.getAuthInformation(SAMPLE_CONTEXT_B);
assertTrue("Database has record about this context.",
Arrays.equals(SAMPLE_PASSWORD, auth.getPassword()));
assertEquals("Database has record about this context.",
SAMPLE_USERNAME, auth.getUserName());
}