Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit bf44232

Browse files
committed
Updated test case
1 parent 8c8ba47 commit bf44232

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/test/java/org/kohsuke/github/GHContentIntegrationTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
package org.kohsuke.github;
22

3-
import junit.framework.TestCase;
3+
import org.junit.Before;
4+
import org.junit.Test;
45

56
import java.util.List;
6-
import java.util.UUID;
77

88
/**
99
* Integration test for {@link GHContent}.
1010
*/
11-
public class GHContentIntegrationTest extends TestCase {
11+
public class GHContentIntegrationTest extends AbstractGitHubApiTestBase {
1212

13-
private GitHub gitHub;
1413
private GHRepository repo;
15-
private String createdFilename;
14+
private String createdFilename = rnd.next();
1615

16+
@Before
1717
@Override
1818
public void setUp() throws Exception {
1919
super.setUp();
20-
21-
gitHub = GitHub.connect();
22-
repo = gitHub.getRepository("acollign/github-api-test").fork();
23-
createdFilename = UUID.randomUUID().toString();
20+
repo = gitHub.getRepository("github-api-test-org/github-api-test").fork();
2421
}
2522

23+
@Test
2624
public void testGetFileContent() throws Exception {
2725
GHContent content = repo.getFileContent("ghcontent-ro/a-file-with-content");
2826

2927
assertTrue(content.isFile());
3028
assertEquals("thanks for reading me\n", content.getContent());
3129
}
3230

31+
@Test
3332
public void testGetEmptyFileContent() throws Exception {
3433
GHContent content = repo.getFileContent("ghcontent-ro/an-empty-file");
3534

3635
assertTrue(content.isFile());
3736
assertEquals("", content.getContent());
3837
}
3938

39+
@Test
4040
public void testGetDirectoryContent() throws Exception {
4141
List<GHContent> entries = repo.getDirectoryContent("ghcontent-ro/a-dir-with-3-entries");
4242

4343
assertTrue(entries.size() == 3);
4444
}
4545

46+
@Test
4647
public void testCRUDContent() throws Exception {
4748
GHContentUpdateResponse created = repo.createContent("this is an awesome file I created\n", "Creating a file for integration tests.", createdFilename);
4849
GHContent createdContent = created.getContent();

0 commit comments

Comments
 (0)