66import okhttp3 .OkHttpClient ;
77import org .apache .commons .io .FileUtils ;
88import org .junit .Before ;
9- import org .junit .Ignore ;
109import org .junit .Test ;
1110import org .kohsuke .github .AbstractGitHubWireMockTest ;
12- import org .kohsuke .github .GHContent ;
13- import org .kohsuke .github .GHException ;
1411import org .kohsuke .github .GHFileNotFoundException ;
1512import org .kohsuke .github .GHIssueState ;
1613import org .kohsuke .github .GHPullRequest ;
2017
2118import java .io .File ;
2219import java .io .IOException ;
23- import java .util .List ;
24-
25- import static org .hamcrest .core .Is .is ;
2620
2721/**
2822 * Test showing the behavior of OkHttpConnector cache with GitHub 404 responses.
@@ -40,8 +34,8 @@ public GitHubCachingTest() {
4034 @ Override
4135 protected WireMockConfiguration getWireMockOptions () {
4236 return super .getWireMockOptions ()
43- // Use the same data files as the 2.x test
44- .usingFilesUnderDirectory (baseRecordPath .replace ("/okhttp3/" , "/" ))
37+ // Use the same data files as the 2.x test
38+ .usingFilesUnderDirectory (baseRecordPath .replace ("/okhttp3/" , "/" ))
4539 .extensions (ResponseTemplateTransformer .builder ().global (true ).maxCacheEntries (0L ).build ());
4640 }
4741
@@ -59,19 +53,10 @@ public void setupRepo() throws Exception {
5953 }
6054 }
6155
62- @ Test
63- public void OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error_runnable () throws Exception {
64-
65- requireProxy ("This test method can be run locally for debugging and analyzing." );
66- OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error ();
67- }
68-
69- // @Ignore("The wiremock snapshot files attached to this test method show what was sent to and from the server during a run, but they aren't re-runnable - not templated.")
7056 @ Test
7157 public void OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error () throws Exception {
7258 // ISSUE #669
73- // requireProxy("For clarity. Will switch to snapshot shortly.");
74- // snapshotNotAllowed();
59+ snapshotNotAllowed ();
7560
7661 OkHttpClient client = createClient (true );
7762 OkHttpConnector connector = new OkHttpConnector (client );
@@ -178,8 +163,8 @@ private OkHttpClient createClient(boolean useCache) throws IOException {
178163 OkHttpClient .Builder builder = new OkHttpClient ().newBuilder ();
179164
180165 if (useCache ) {
181- File cacheDir = new File ("target/cache/" + baseFilesClassPath + "/" + mockGitHub . getMethodName ()
182- + clientCount ++);
166+ File cacheDir = new File (
167+ "target/cache/" + baseFilesClassPath + "/" + mockGitHub . getMethodName () + clientCount ++);
183168 cacheDir .mkdirs ();
184169 FileUtils .cleanDirectory (cacheDir );
185170 Cache cache = new Cache (cacheDir , 100 * 1024L * 1024L );
0 commit comments