### Question:
ServiceAuthenticationServiceImpl implements ServiceAuthenticationService { public Authentication getAuthentication(InstanceInfo instanceInfo) { final Map<String, String> metadata = instanceInfo.getMetadata(); final Authentication out = new Authentication(); out.setApplid(metadata.get(AUTHENTICATION_APPLID)); out.setScheme(AuthenticationScheme.fromScheme(metadata.get(AUTHENTICATION_SCHEME))); return out; }  Authentication getAuthentication(InstanceInfo instanceInfo); @Override @CacheEvict(value = CACHE_BY_AUTHENTICATION, condition = "#result != null && #result.isExpired()") @Cacheable(CACHE_BY_AUTHENTICATION) AuthenticationCommand getAuthenticationCommand(Authentication authentication, String jwtToken); @Override @RetryIfExpired @CacheEvict( value = CACHE_BY_SERVICE_ID, condition = "#result != null && #result.isExpired()", keyGenerator = CacheConfig.COMPOSITE_KEY_GENERATOR ) @Cacheable(value = CACHE_BY_SERVICE_ID, keyGenerator = CacheConfig.COMPOSITE_KEY_GENERATOR) AuthenticationCommand getAuthenticationCommand(String serviceId, String jwtToken); @Override @CacheEvict(value = CACHE_BY_SERVICE_ID, allEntries = true) void evictCacheAllService(); @Override void evictCacheService(String serviceId); static final String AUTHENTICATION_COMMAND_KEY; }### Answer:
@Test void testGetAuthentication() { InstanceInfo ii; ii = createInstanceInfo("instance1", "bypass", "applid"); assertEquals(new Authentication(AuthenticationScheme.BYPASS, "applid"), serviceAuthenticationServiceImpl.getAuthentication(ii)); ii = createInstanceInfo("instance2", "zoweJwt", "applid2"); assertEquals(new Authentication(AuthenticationScheme.ZOWE_JWT, "applid2"), serviceAuthenticationServiceImpl.getAuthentication(ii)); ii = createInstanceInfo("instance2", "httpBasicPassTicket", null); assertEquals(new Authentication(AuthenticationScheme.HTTP_BASIC_PASSTICKET, null), serviceAuthenticationServiceImpl.getAuthentication(ii)); ii = createInstanceInfo("instance2", (AuthenticationScheme) null, null); assertEquals(new Authentication(), serviceAuthenticationServiceImpl.getAuthentication(ii)); }