@BeforeEach
    void setUp() throws Exception {
        MockitoAnnotations.openMocks(this);

        host = new HttpHost("foo.example.com", 80);

        route = new HttpRoute(host);

        body = HttpTestUtils.makeBody(ENTITY_LENGTH);

        request = new BasicClassicHttpRequest("GET", "/foo");

        context = HttpCacheContext.create();

        originResponse = HttpTestUtils.make200Response();

        config = CacheConfig.custom()
                .setMaxCacheEntries(MAX_ENTRIES)
                .setMaxObjectSize(MAX_BYTES)
                .build();

        cache = new BasicHttpCache(config);
        impl = new CachingExec(cache, null, config);

        executorService = new ScheduledThreadPoolExecutor(1);

        Mockito.when(mockExecChain.proceed(Mockito.any(), Mockito.any())).thenReturn(originResponse);
        Mockito.when(mockExecRuntime.fork(null)).thenReturn(mockExecRuntime);
    }
A suite of acceptance tests for compliance with RFC5861, which
describes the stale-if-error and stale-while-revalidate
Cache-Control extensions.
httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestRFC5861Compliance.java