Skip to content

Commit 6a356c8

Browse files
committed
Fixed up tests
1 parent 70f0f57 commit 6a356c8

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,10 +850,7 @@ protected void wrapUp(GHCommitComment[] page) {
850850
/**
851851
* Gets the basic license details for the repository.
852852
* <p>
853-
* This is a preview item and requires you to use {@link org.kohsuke.github.extras.PreviewHttpConnector}
854-
* <p>
855-
* Warning: Only returns the basic license details. Use {@link GitHub#getLicense(String)}
856-
* to get the full license information (hint: pass it {@link GHLicenseBase#getKey()}).
853+
* This is a preview item and subject to change.
857854
*
858855
* @throws IOException as usual but also if you don't use the preview connector
859856
*/
@@ -868,11 +865,12 @@ public GHLicense getLicense() throws IOException{
868865
/**
869866
* Retrieves the contents of the repository's license file - makes an additional API call
870867
* <p>
871-
* This is a preview item and requires you to use {@link org.kohsuke.github.extras.PreviewHttpConnector}
868+
* This is a preview item and subject to change.
872869
*
873870
* @return details regarding the license contents
874871
* @throws IOException as usual but also if you don't use the preview connector
875872
*/
873+
@Preview @Deprecated
876874
public GHContent getLicenseContent() throws IOException {
877875
return root.retrieve().to(getApiTailUrl("license"), GHContent.class).wrap(this);
878876
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828
import org.junit.Assert;
2929
import org.junit.Before;
3030
import org.junit.Test;
31-
import org.kohsuke.github.extras.PreviewHttpConnector;
3231

3332
import java.io.IOException;
3433
import java.net.URL;
35-
import java.util.List;
3634

3735
/**
3836
* @author Duncan Dickinson
@@ -54,8 +52,8 @@ public void setUp() throws Exception {
5452
*/
5553
@Test
5654
public void listLicenses() throws IOException {
57-
List<GHLicense> licenses = gitHub.listLicenses();
58-
assertTrue(licenses.size() > 0);
55+
Iterable<GHLicense> licenses = gitHub.listLicenses();
56+
assertTrue(licenses.iterator().hasNext());
5957
}
6058

6159
/**
@@ -66,7 +64,7 @@ public void listLicenses() throws IOException {
6664
*/
6765
@Test
6866
public void listLicensesCheckIndividualLicense() throws IOException {
69-
List<GHLicense> licenses = gitHub.listLicenses();
67+
PagedIterable<GHLicense> licenses = gitHub.listLicenses();
7068
for (GHLicense lic : licenses) {
7169
if (lic.getKey().equals("mit")) {
7270
assertTrue(lic.getUrl().equals(new URL("https://api.github.com/licenses/mit")));

0 commit comments

Comments
 (0)