@Test public void testRepositoryGetServices() throws Exception { RedisKeysRepository repository = new RedisKeysRepository(pool); Map<String, String> services = repository.getServices(); assertEquals(services.size(), 3); assertTrue(Boolean.valueOf(services.get(SERVICE_A_OPEN))); assertTrue(Boolean.valueOf(services.get(WHO_AM_I))); assertTrue(!Boolean.valueOf(services.get(SERVICE_B_BLOCKED))); Optional<Boolean> service = repository.getService("/" + SERVICE_A_OPEN + "/" + PROD7340_OPED); assertTrue(service.isPresent()); assertTrue(service.get().booleanValue()); }
@Test public void testRepositoryGetProducts() throws Exception { RedisKeysRepository repository = new RedisKeysRepository(pool); Map<String, String> products = repository.getProducts(); assertEquals(products.size(), 1); assertTrue(!Boolean.valueOf(products.get(PROD3568_BLOCKED))); Optional<Boolean> product = repository.getProduct("/" + SERVICE_A_OPEN + "/" + PROD3568_BLOCKED); assertTrue(product.isPresent()); assertTrue(!product.get().booleanValue()); }