OperationSupportCheckerImpl implements OperationSupportChecker { @Override public boolean isOperationSupported(CloudType cloudType, OperationType operationType) { try { return operationsCache.get(cloudType).contains(operationType); } catch (ExecutionException e) { throw new RuntimeException(e); } } @Autowired  OperationSupportCheckerImpl(ServiceRepository serviceRepository); @Override boolean isOperationSupported(CloudType cloudType, OperationType operationType); @Override Collection<T> filter(Collection<T> input, Function<T, CloudType> cloudTypeProvider, OperationType operationType);  }
@Test public void testIsOperationSupported() { assertThat(operationSupportChecker.isOperationSupported(MOCK, ADD_IMAGE), is(true)); assertThat(operationSupportChecker.isOperationSupported(MOCK, ADD_INSTANCE), is(false)); assertThat(operationSupportChecker.isOperationSupported(DOCKER, ADD_IMAGE), is(false)); }
@Test public void testRepositoryFailure() { testRepository.setFail(true); assertThat(operationSupportChecker.isOperationSupported(MOCK, ADD_IMAGE), is(false)); }