File tree Expand file tree Collapse file tree
src/test/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,32 @@ public void getPermission() throws Exception {
6767 }
6868 }
6969 }
70+
71+
72+
73+ @ Test
74+ public void LatestRepositoryExist () {
75+ try {
76+ // add the repository that have latest release
77+ GHRelease release = gitHub .getRepository ("kamontat/CheckIDNumber" ).getLatestRelease ();
78+ assertEquals ("v3.0" , release .getTagName ());
79+ } catch (IOException e ) {
80+ e .printStackTrace ();
81+ fail ();
82+ }
83+ }
84+
85+ @ Test
86+ public void LatestRepositoryNotExist () {
87+ try {
88+ // add the repository that `NOT` have latest release
89+ GHRelease release = gitHub .getRepository ("kamontat/Java8Example" ).getLatestRelease ();
90+ assertNull (release );
91+ } catch (IOException e ) {
92+ e .printStackTrace ();
93+ fail ();
94+ }
95+ }
7096
7197 private GHRepository getRepository () throws IOException {
7298 return gitHub .getOrganization ("github-api-test-org" ).getRepository ("jenkins" );
You can’t perform that action at this time.
0 commit comments