### Question:
TokenService { public TokenInfo updateTokenFriendlyName(String tokenId, String friendlyName) throws TokenNotFoundException, ActionNotPossibleException { TokenInfo tokenInfo = getToken(tokenId); auditDataHelper.put(tokenInfo); auditDataHelper.put(TOKEN_FRIENDLY_NAME, friendlyName); possibleActionsRuleEngine.requirePossibleTokenAction(PossibleActionEnum.EDIT_FRIENDLY_NAME, tokenInfo); try { signerProxyFacade.setTokenFriendlyName(tokenId, friendlyName); tokenInfo = signerProxyFacade.getToken(tokenId); } catch (CodedException e) { if (isCausedByTokenNotFound(e)) { throw new TokenNotFoundException(e); } else { throw e; } } catch (Exception other) { throw new SignerNotReachableException("update token friendly name failed", other); } return tokenInfo; } @Autowired  TokenService(SignerProxyFacade signerProxyFacade,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            AuditDataHelper auditDataHelper); List<TokenInfo> getAllTokens(); List<CertificateInfo> getSignCertificates(ClientType clientType); List<CertificateInfo> getAllCertificates(ClientType clientType); void activateToken(String id, char[] password); void deactivateToken(String id); TokenInfo getToken(String id); TokenInfo updateTokenFriendlyName(String tokenId, String friendlyName); TokenInfo getTokenForKeyId(String keyId); TokenInfoAndKeyId getTokenAndKeyIdForCertificateHash(String hash); boolean isSoftwareTokenInitialized(); TokenInitStatusInfo getSoftwareTokenInitStatus(); TokenInfoAndKeyId getTokenAndKeyIdForCertificateRequestId(String csrId); boolean hasHardwareTokens();  }### Answer:
@Test public void updateTokenFriendlyName() throws Exception { TokenInfo tokenInfo = tokenService.getToken(GOOD_TOKEN_ID); assertEquals(GOOD_TOKEN_NAME, tokenInfo.getFriendlyName()); tokenInfo = tokenService.updateTokenFriendlyName(GOOD_TOKEN_ID, "friendly-neighborhood"); assertEquals("friendly-neighborhood", tokenInfo.getFriendlyName()); }
@Test(expected = TokenNotFoundException.class) public void updateNonExistingTokenFriendlyName() throws Exception { tokenService.updateTokenFriendlyName(TOKEN_NOT_FOUND_TOKEN_ID, "new-name"); }