Clean up and formatting

This commit is contained in:
Liam Newman
2020-01-17 17:05:45 -08:00
parent 54f4152f89
commit 3479e4f2fd
3 changed files with 10 additions and 41 deletions

View File

@@ -7,11 +7,8 @@ import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.kohsuke.github.AbstractGitHubWireMockTest;
import org.kohsuke.github.GHContent;
import org.kohsuke.github.GHException;
import org.kohsuke.github.GHFileNotFoundException;
import org.kohsuke.github.GHIssueState;
import org.kohsuke.github.GHPullRequest;
@@ -21,9 +18,6 @@ import org.kohsuke.github.GitHub;
import java.io.File;
import java.io.IOException;
import java.util.List;
import static org.hamcrest.core.Is.is;
/**
* Test showing the behavior of OkHttpConnector cache with GitHub 404 responses.
@@ -58,18 +52,10 @@ public class GitHubCachingTest extends AbstractGitHubWireMockTest {
}
}
@Test
public void OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error_runnable() throws Exception {
requireProxy("This test method can be run locally for debugging and analyzing.");
OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error();
}
@Test
public void OkHttpConnector_Cache_MaxAgeDefault_Zero_GitHubRef_Error() throws Exception {
// ISSUE #669
// requireProxy("For clarity. Will switch to snapshot shortly.");
// snapshotNotAllowed();
snapshotNotAllowed();
OkHttpClient client = createClient(true);
OkHttpConnector connector = new OkHttpConnector(new OkUrlFactory(client));
@@ -176,8 +162,8 @@ public class GitHubCachingTest extends AbstractGitHubWireMockTest {
OkHttpClient client = new OkHttpClient();
if (useCache) {
File cacheDir = new File("target/cache/" + baseFilesClassPath + "/" + mockGitHub.getMethodName()
+ clientCount++);
File cacheDir = new File(
"target/cache/" + baseFilesClassPath + "/" + mockGitHub.getMethodName() + clientCount++);
cacheDir.mkdirs();
FileUtils.cleanDirectory(cacheDir);
Cache cache = new Cache(cacheDir, 100 * 1024L * 1024L);