### Question:
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);  }### Answer:
@Test public void convertDeletedTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_DELETED); assertEquals(IDENTIFYING_TOKEN_DELETED.getToken(), authorisationData.getIdTag()); assertNull(authorisationData.getIdTagInfo()); }
@Test public void convertEmptyStatusTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(ChargingStationTestUtils.IDENTIFYING_TOKEN); assertEquals(ChargingStationTestUtils.IDENTIFYING_TOKEN.getToken(), authorisationData.getIdTag()); assertNull(authorisationData.getIdTagInfo()); }
@Test public void convertAcceptedTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_ACCEPTED); assertEquals(IDENTIFYING_TOKEN_ACCEPTED.getToken(), authorisationData.getIdTag()); assertEquals(AuthorizationStatus.ACCEPTED, authorisationData.getIdTagInfo().getStatus()); }
@Test public void convertBlockedTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_BLOCKED); assertEquals(IDENTIFYING_TOKEN_BLOCKED.getToken(), authorisationData.getIdTag()); assertEquals(AuthorizationStatus.BLOCKED, authorisationData.getIdTagInfo().getStatus()); }
@Test public void convertExpiredTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_EXPIRED); assertEquals(IDENTIFYING_TOKEN_EXPIRED.getToken(), authorisationData.getIdTag()); assertEquals(AuthorizationStatus.EXPIRED, authorisationData.getIdTagInfo().getStatus()); }
@Test public void convertInvalidTokenVerifyReturnValue() { AuthorisationData authorisationData = service.convertIdentifyingToken(IDENTIFYING_TOKEN_INVALID); assertEquals(IDENTIFYING_TOKEN_INVALID.getToken(), authorisationData.getIdTag()); assertEquals(AuthorizationStatus.INVALID, authorisationData.getIdTagInfo().getStatus()); }
@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()); }