@Test public void convertConcurrentTxTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_CONCURRENT_TX); assertEquals(IDENTIFYING_TOKEN_CONCURRENT_TX.getToken(), authorisationData.getIdTag()); assertEquals(AuthorizationStatus.CONCURRENT_TX, authorisationData.getIdTagInfo().getStatus()); }
public AuthorisationData convertIdentifyingToken(IdentifyingToken token) { AuthorisationData authData = new AuthorisationData(); authData.setIdTag(token.getToken()); IdentifyingToken.AuthenticationStatus status = token.getAuthenticationStatus(); if (status != null && !IdentifyingToken.AuthenticationStatus.DELETED.equals(status)) { IdTagInfo info = new IdTagInfo(); switch (token.getAuthenticationStatus()) { case ACCEPTED: info.setStatus(AuthorizationStatus.ACCEPTED); break; case BLOCKED: info.setStatus(AuthorizationStatus.BLOCKED); break; case EXPIRED: info.setStatus(AuthorizationStatus.EXPIRED); break; case INVALID: info.setStatus(AuthorizationStatus.INVALID); break; case CONCURRENT_TX: info.setStatus(AuthorizationStatus.CONCURRENT_TX); break; default: throw new AssertionError(String.format("Unknown authentication status [%s] in given identifying token [%s].", token.getAuthenticationStatus(), token.getToken())); } authData.setIdTagInfo(info); } return authData; }
IdentifyingTokenConverterService { public AuthorisationData convertIdentifyingToken(IdentifyingToken token) { AuthorisationData authData = new AuthorisationData(); authData.setIdTag(token.getToken()); IdentifyingToken.AuthenticationStatus status = token.getAuthenticationStatus(); if (status != null && !IdentifyingToken.AuthenticationStatus.DELETED.equals(status)) { IdTagInfo info = new IdTagInfo(); switch (token.getAuthenticationStatus()) { case ACCEPTED: info.setStatus(AuthorizationStatus.ACCEPTED); break; case BLOCKED: info.setStatus(AuthorizationStatus.BLOCKED); break; case EXPIRED: info.setStatus(AuthorizationStatus.EXPIRED); break; case INVALID: info.setStatus(AuthorizationStatus.INVALID); break; case CONCURRENT_TX: info.setStatus(AuthorizationStatus.CONCURRENT_TX); break; default: throw new AssertionError(String.format("Unknown authentication status [%s] in given identifying token [%s].", token.getAuthenticationStatus(), token.getToken())); } authData.setIdTagInfo(info); } return authData; } }
IdentifyingTokenConverterService { public AuthorisationData convertIdentifyingToken(IdentifyingToken token) { AuthorisationData authData = new AuthorisationData(); authData.setIdTag(token.getToken()); IdentifyingToken.AuthenticationStatus status = token.getAuthenticationStatus(); if (status != null && !IdentifyingToken.AuthenticationStatus.DELETED.equals(status)) { IdTagInfo info = new IdTagInfo(); switch (token.getAuthenticationStatus()) { case ACCEPTED: info.setStatus(AuthorizationStatus.ACCEPTED); break; case BLOCKED: info.setStatus(AuthorizationStatus.BLOCKED); break; case EXPIRED: info.setStatus(AuthorizationStatus.EXPIRED); break; case INVALID: info.setStatus(AuthorizationStatus.INVALID); break; case CONCURRENT_TX: info.setStatus(AuthorizationStatus.CONCURRENT_TX); break; default: throw new AssertionError(String.format("Unknown authentication status [%s] in given identifying token [%s].", token.getAuthenticationStatus(), token.getToken())); } authData.setIdTagInfo(info); } return authData; }  }
IdentifyingTokenConverterService { public AuthorisationData convertIdentifyingToken(IdentifyingToken token) { AuthorisationData authData = new AuthorisationData(); authData.setIdTag(token.getToken()); IdentifyingToken.AuthenticationStatus status = token.getAuthenticationStatus(); if (status != null && !IdentifyingToken.AuthenticationStatus.DELETED.equals(status)) { IdTagInfo info = new IdTagInfo(); switch (token.getAuthenticationStatus()) { case ACCEPTED: info.setStatus(AuthorizationStatus.ACCEPTED); break; case BLOCKED: info.setStatus(AuthorizationStatus.BLOCKED); break; case EXPIRED: info.setStatus(AuthorizationStatus.EXPIRED); break; case INVALID: info.setStatus(AuthorizationStatus.INVALID); break; case CONCURRENT_TX: info.setStatus(AuthorizationStatus.CONCURRENT_TX); break; default: throw new AssertionError(String.format("Unknown authentication status [%s] in given identifying token [%s].", token.getAuthenticationStatus(), token.getToken())); } authData.setIdTagInfo(info); } return authData; }  Set<AuthorisationData> convertIdentifyingTokenList(Set<IdentifyingToken> tokens); AuthorisationData convertIdentifyingToken(IdentifyingToken token); }
IdentifyingTokenConverterService { public AuthorisationData convertIdentifyingToken(IdentifyingToken token) { AuthorisationData authData = new AuthorisationData(); authData.setIdTag(token.getToken()); IdentifyingToken.AuthenticationStatus status = token.getAuthenticationStatus(); if (status != null && !IdentifyingToken.AuthenticationStatus.DELETED.equals(status)) { IdTagInfo info = new IdTagInfo(); switch (token.getAuthenticationStatus()) { case ACCEPTED: info.setStatus(AuthorizationStatus.ACCEPTED); break; case BLOCKED: info.setStatus(AuthorizationStatus.BLOCKED); break; case EXPIRED: info.setStatus(AuthorizationStatus.EXPIRED); break; case INVALID: info.setStatus(AuthorizationStatus.INVALID); break; case CONCURRENT_TX: info.setStatus(AuthorizationStatus.CONCURRENT_TX); break; default: throw new AssertionError(String.format("Unknown authentication status [%s] in given identifying token [%s].", token.getAuthenticationStatus(), token.getToken())); } authData.setIdTagInfo(info); } return authData; }  Set<AuthorisationData> convertIdentifyingTokenList(Set<IdentifyingToken> tokens); AuthorisationData convertIdentifyingToken(IdentifyingToken token);  }