HystrixTeamOperations implements TeamOperations { @Override @Cacheable(cacheNames = "aws-accounts-by-user", cacheManager = "oneMinuteTTLCacheManager") @HystrixCommand(ignoreExceptions = {HttpClientErrorException.class, IllegalArgumentException.class}) public List<Account> getAwsAccountsByUser(final String userId) { return delegate.getAwsAccountsByUser(userId); } HystrixTeamOperations(final TeamOperations delegate); @Override @Cacheable(cacheNames = "aws-accounts-by-user", cacheManager = "oneMinuteTTLCacheManager") @HystrixCommand(ignoreExceptions = {HttpClientErrorException.class, IllegalArgumentException.class}) List<Account> getAwsAccountsByUser(final String userId); @Override @Cacheable(cacheNames = "team-ids-by-user", cacheManager = "oneMinuteTTLCacheManager") @HystrixCommand(ignoreExceptions = {HttpClientErrorException.class, IllegalArgumentException.class}) Set<String> getTeamIdsByUser(final String userId); @Override @Cacheable(cacheNames = "active-aws-accounts", cacheManager = "oneMinuteTTLCacheManager") @HystrixCommand(ignoreExceptions = HttpClientErrorException.class) List<Account> getActiveAccounts();  }
@Test public void testGetTeamsByUser() throws Exception { when(mockDelegate.getAwsAccountsByUser(anyString())).thenReturn(ACCOUNTS); assertThat(hystrixTeamOperations.getAwsAccountsByUser(USER_ID)).isSameAs(ACCOUNTS); verify(mockDelegate).getAwsAccountsByUser(same(USER_ID)); }