    @Test
    public void testListResourcesOfApp() {

        // prepare basic test data
        testSave();
        System.out.println( "[" + System.currentTimeMillis() + "] Basic test data ready in testListResourcesOfApp");

        List<CompletableFuture> futures = Lists.newArrayList();

        // concurrent query resources of app
        final CyclicBarrier cyclicBarrier = new CyclicBarrier(AVAILABLE_CPU_PROCESSORS);
        for (int j = 0; j < 10000; j++) {
            futures.add(
                CompletableFuture.runAsync(() -> {
                        try {
                            cyclicBarrier.await();
                            inMemoryMetricsRepository.listResourcesOfApp(DEFAULT_APP);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        } catch (BrokenBarrierException e) {
                            e.printStackTrace();
                        }
                    }, executorService
                ));
        }

        // batch add metric entity
        for (int i = 0; i < 10000; i++) {
            MetricEntity entry = new MetricEntity();
            entry.setApp(DEFAULT_APP);
            entry.setResource(DEFAULT_RESOURCE);
            entry.setTimestamp(new Date(System.currentTimeMillis() - EXPIRE_TIME - 1000L));
            entry.setPassQps(1L);
            entry.setExceptionQps(1L);
            entry.setBlockQps(0L);
            entry.setSuccessQps(1L);
            inMemoryMetricsRepository.save(entry);
        }

        CompletableFuture all = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
        try {
            all.join();
        } catch (ConcurrentModificationException e) {
            e.printStackTrace();
            fail("concurrent error occurred");
        }
    }