@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()); }
public OAuthEntry convertToEntry(final OAuthDomainEntry dto) { OAuthEntry entry = new OAuthEntry(); entry.setAppId(dto.getAppId()); entry.setAuthorized(dto.isAuthorized()); entry.setCallbackToken(dto.getCallbackToken()); entry.setCallbackTokenAttempts(dto.getCallbackTokenAttempts()); entry.setCallbackUrl(dto.getCallbackUrl()); entry.setCallbackUrlSigned(dto.isCallbackUrlSigned()); entry.setConsumerKey(dto.getConsumer().getConsumerKey()); entry.setContainer(dto.getContainer()); entry.setDomain(dto.getDomain()); entry.setIssueTime(dto.getIssueTime()); entry.setOauthVersion(dto.getOauthVersion()); entry.setToken(dto.getToken()); entry.setTokenSecret(dto.getTokenSecret()); entry.setType(Type.valueOf(dto.getType())); entry.setUserId(dto.getUserId()); return entry; }
OAuthEntryConversionStrategy { public OAuthEntry convertToEntry(final OAuthDomainEntry dto) { OAuthEntry entry = new OAuthEntry(); entry.setAppId(dto.getAppId()); entry.setAuthorized(dto.isAuthorized()); entry.setCallbackToken(dto.getCallbackToken()); entry.setCallbackTokenAttempts(dto.getCallbackTokenAttempts()); entry.setCallbackUrl(dto.getCallbackUrl()); entry.setCallbackUrlSigned(dto.isCallbackUrlSigned()); entry.setConsumerKey(dto.getConsumer().getConsumerKey()); entry.setContainer(dto.getContainer()); entry.setDomain(dto.getDomain()); entry.setIssueTime(dto.getIssueTime()); entry.setOauthVersion(dto.getOauthVersion()); entry.setToken(dto.getToken()); entry.setTokenSecret(dto.getTokenSecret()); entry.setType(Type.valueOf(dto.getType())); entry.setUserId(dto.getUserId()); return entry; } }
OAuthEntryConversionStrategy { public OAuthEntry convertToEntry(final OAuthDomainEntry dto) { OAuthEntry entry = new OAuthEntry(); entry.setAppId(dto.getAppId()); entry.setAuthorized(dto.isAuthorized()); entry.setCallbackToken(dto.getCallbackToken()); entry.setCallbackTokenAttempts(dto.getCallbackTokenAttempts()); entry.setCallbackUrl(dto.getCallbackUrl()); entry.setCallbackUrlSigned(dto.isCallbackUrlSigned()); entry.setConsumerKey(dto.getConsumer().getConsumerKey()); entry.setContainer(dto.getContainer()); entry.setDomain(dto.getDomain()); entry.setIssueTime(dto.getIssueTime()); entry.setOauthVersion(dto.getOauthVersion()); entry.setToken(dto.getToken()); entry.setTokenSecret(dto.getTokenSecret()); entry.setType(Type.valueOf(dto.getType())); entry.setUserId(dto.getUserId()); return entry; } OAuthEntryConversionStrategy(final DomainMapper<String, OAuthConsumer> inMapper); }
OAuthEntryConversionStrategy { public OAuthEntry convertToEntry(final OAuthDomainEntry dto) { OAuthEntry entry = new OAuthEntry(); entry.setAppId(dto.getAppId()); entry.setAuthorized(dto.isAuthorized()); entry.setCallbackToken(dto.getCallbackToken()); entry.setCallbackTokenAttempts(dto.getCallbackTokenAttempts()); entry.setCallbackUrl(dto.getCallbackUrl()); entry.setCallbackUrlSigned(dto.isCallbackUrlSigned()); entry.setConsumerKey(dto.getConsumer().getConsumerKey()); entry.setContainer(dto.getContainer()); entry.setDomain(dto.getDomain()); entry.setIssueTime(dto.getIssueTime()); entry.setOauthVersion(dto.getOauthVersion()); entry.setToken(dto.getToken()); entry.setTokenSecret(dto.getTokenSecret()); entry.setType(Type.valueOf(dto.getType())); entry.setUserId(dto.getUserId()); return entry; } OAuthEntryConversionStrategy(final DomainMapper<String, OAuthConsumer> inMapper); OAuthDomainEntry convertToEntryDTO(final OAuthEntry entry); OAuthEntry convertToEntry(final OAuthDomainEntry dto); }
OAuthEntryConversionStrategy { public OAuthEntry convertToEntry(final OAuthDomainEntry dto) { OAuthEntry entry = new OAuthEntry(); entry.setAppId(dto.getAppId()); entry.setAuthorized(dto.isAuthorized()); entry.setCallbackToken(dto.getCallbackToken()); entry.setCallbackTokenAttempts(dto.getCallbackTokenAttempts()); entry.setCallbackUrl(dto.getCallbackUrl()); entry.setCallbackUrlSigned(dto.isCallbackUrlSigned()); entry.setConsumerKey(dto.getConsumer().getConsumerKey()); entry.setContainer(dto.getContainer()); entry.setDomain(dto.getDomain()); entry.setIssueTime(dto.getIssueTime()); entry.setOauthVersion(dto.getOauthVersion()); entry.setToken(dto.getToken()); entry.setTokenSecret(dto.getTokenSecret()); entry.setType(Type.valueOf(dto.getType())); entry.setUserId(dto.getUserId()); return entry; } OAuthEntryConversionStrategy(final DomainMapper<String, OAuthConsumer> inMapper); OAuthDomainEntry convertToEntryDTO(final OAuthEntry entry); OAuthEntry convertToEntry(final OAuthDomainEntry dto);  }