* Test successful conversion of an {@link OAuthDomainEntry} to an {@link OAuthEntry}.
*/
@Test
public void testSuccessfulDtoToEntry()
{
OAuthDomainEntry dto = new OAuthDomainEntry();
dto.setAppId("appId");
dto.setAuthorized(true);
dto.setCallbackToken("callbacktoken");
dto.setCallbackTokenAttempts(0);
dto.setCallbackUrl("callbackurl");
dto.setCallbackUrlSigned(true);
dto.setConsumer(new OAuthConsumer(null, null, "key", null, null));
dto.setContainer("container");
dto.setDomain("domain");
dto.setIssueTime(new Date());
dto.setOauthVersion("1.0");
dto.setToken("token");
dto.setTokenSecret("tokensecret");
dto.setType(Type.ACCESS.toString());
dto.setUserId("userid");
OAuthEntry entry = sut.convertToEntry(dto);
assertEquals(entry.getAppId(), dto.getAppId());
assertEquals(entry.isAuthorized(), dto.isAuthorized());
assertEquals(entry.getCallbackToken(), dto.getCallbackToken());
assertEquals(entry.getCallbackTokenAttempts(), dto.getCallbackTokenAttempts());
assertEquals(entry.getCallbackUrl(), dto.getCallbackUrl());
assertEquals(entry.isCallbackUrlSigned(), dto.isCallbackUrlSigned());
assertEquals(entry.getConsumerKey(), dto.getConsumer().getConsumerKey());
assertEquals(entry.getContainer(), dto.getContainer());
assertEquals(entry.getDomain(), dto.getDomain());
assertEquals(entry.getIssueTime(), dto.getIssueTime());
assertEquals(entry.getOauthVersion(), dto.getOauthVersion());
assertEquals(entry.getToken(), dto.getToken());
assertEquals(entry.getTokenSecret(), dto.getTokenSecret());
assertEquals(entry.getType(), Type.valueOf(dto.getType()));
assertEquals(entry.getUserId(), dto.getUserId());
}