@Test
public void shouldReturnSsoAssociationWhenHandleExistingInPersistenceForSHA256Given() {
DateTime expiry = new DateTime(2012, 1, 1, 12, 0 );
byte[] key = new byte[] { 1, 2, 3 };
OpenIdAssociation ssoAssociation = new OpenIdAssociation("test-handle", Association.TYPE_HMAC_SHA256,
expiry, key);
when(daoMock.load("test-handle")).thenReturn(ssoAssociation);
Association association = store.load("test-handle");
assertNotNull(association);
assertEquals(association.getExpiry(), ssoAssociation.getExpiry().toDate());
assertEquals(association.getHandle(), ssoAssociation.getHandle());
assertEquals(association.getType(), ssoAssociation.getType());
assertArrayEquals(association.getMacKey().getEncoded(), ssoAssociation.getKey());
}