mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
Fixed up tests
This commit is contained in:
@@ -850,10 +850,7 @@ public class GHRepository extends GHObject {
|
||||
/**
|
||||
* Gets the basic license details for the repository.
|
||||
* <p>
|
||||
* This is a preview item and requires you to use {@link org.kohsuke.github.extras.PreviewHttpConnector}
|
||||
* <p>
|
||||
* Warning: Only returns the basic license details. Use {@link GitHub#getLicense(String)}
|
||||
* to get the full license information (hint: pass it {@link GHLicenseBase#getKey()}).
|
||||
* This is a preview item and subject to change.
|
||||
*
|
||||
* @throws IOException as usual but also if you don't use the preview connector
|
||||
*/
|
||||
@@ -868,11 +865,12 @@ public class GHRepository extends GHObject {
|
||||
/**
|
||||
* Retrieves the contents of the repository's license file - makes an additional API call
|
||||
* <p>
|
||||
* This is a preview item and requires you to use {@link org.kohsuke.github.extras.PreviewHttpConnector}
|
||||
* This is a preview item and subject to change.
|
||||
*
|
||||
* @return details regarding the license contents
|
||||
* @throws IOException as usual but also if you don't use the preview connector
|
||||
*/
|
||||
@Preview @Deprecated
|
||||
public GHContent getLicenseContent() throws IOException {
|
||||
return root.retrieve().to(getApiTailUrl("license"), GHContent.class).wrap(this);
|
||||
}
|
||||
|
||||
@@ -28,11 +28,9 @@ import org.apache.commons.io.IOUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.kohsuke.github.extras.PreviewHttpConnector;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Duncan Dickinson
|
||||
@@ -54,8 +52,8 @@ public class GHLicenseTest extends Assert {
|
||||
*/
|
||||
@Test
|
||||
public void listLicenses() throws IOException {
|
||||
List<GHLicense> licenses = gitHub.listLicenses();
|
||||
assertTrue(licenses.size() > 0);
|
||||
Iterable<GHLicense> licenses = gitHub.listLicenses();
|
||||
assertTrue(licenses.iterator().hasNext());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +64,7 @@ public class GHLicenseTest extends Assert {
|
||||
*/
|
||||
@Test
|
||||
public void listLicensesCheckIndividualLicense() throws IOException {
|
||||
List<GHLicense> licenses = gitHub.listLicenses();
|
||||
PagedIterable<GHLicense> licenses = gitHub.listLicenses();
|
||||
for (GHLicense lic : licenses) {
|
||||
if (lic.getKey().equals("mit")) {
|
||||
assertTrue(lic.getUrl().equals(new URL("https://api.github.com/licenses/mit")));
|
||||
|
||||
Reference in New Issue
Block a user