File tree Expand file tree Collapse file tree
main/java/org/kohsuke/github
test/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 2828import org .junit .Assert ;
2929import org .junit .Before ;
3030import org .junit .Test ;
31- import org .kohsuke .github .extras .PreviewHttpConnector ;
3231
3332import java .io .IOException ;
3433import 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" )));
You can’t perform that action at this time.
0 commit comments