File tree Expand file tree Collapse file tree
main/java/com/jcabi/github
test/java/com/jcabi/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ public void remove(
9696 public Iterable <Repo > iterate (
9797 final String identifier ) {
9898 return new RtPagination <>(
99- this .entry .uri ().queryParam ("since" , identifier ).back (),
99+ this .entry .uri ().path ("/repositories" )
100+ .queryParam ("since" , identifier ).back (),
100101 object -> this .get (
101102 new Coordinates .Simple (object .getString ("full_name" ))
102103 )
Original file line number Diff line number Diff line change @@ -92,6 +92,34 @@ void iterateRepos() throws IOException {
9292 }
9393 }
9494
95+ @ Test
96+ void iterateReposUsesPublicRepositoriesPath () throws IOException {
97+ final String identifier = "364" ;
98+ try (
99+ MkContainer container = new MkGrizzlyContainer ().next (
100+ new MkAnswer .Simple (
101+ HttpURLConnection .HTTP_OK ,
102+ Json .createArrayBuilder ()
103+ .add (RtReposTest .response ("octocat" , identifier ))
104+ .build ().toString ()
105+ )
106+ ).start (RandomPort .port ())
107+ ) {
108+ new RtRepos (
109+ Mockito .mock (GitHub .class ),
110+ new ApacheRequest (container .home ())
111+ ).iterate (identifier ).iterator ().next ();
112+ MatcherAssert .assertThat (
113+ "iterate(...) must request /repositories?since=<id>" ,
114+ container .take ().uri ().toString (),
115+ Matchers .endsWith (
116+ "/repositories?since=" .concat (identifier )
117+ )
118+ );
119+ container .stop ();
120+ }
121+ }
122+
95123 @ Test
96124 void removeRepo () throws IOException {
97125 try (
You can’t perform that action at this time.
0 commit comments