File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
main/java/com/jcabi/github
test/java/com/jcabi/github Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 55import java .util .Map ;
66import java .util .stream .Collectors ;
77import javax .json .JsonObject ;
8- import javax .json .JsonValue ;
98import org .cactoos .map .MapEntry ;
109import org .cactoos .map .MapOf ;
1110
@@ -40,13 +39,7 @@ private enum KEY {
4039 }
4140
4241 private MapEntry <String , Object > toEntry (final JsonObject object ) {
43- final String k = this .getKey ();
44- final JsonValue value = object .get (k );
45- return new MapEntry <>(k , value .toString ());
46- }
47-
48- public String getKey () {
49- return key ;
42+ return new MapEntry <>(this .key , object .get (this .key ).toString ());
5043 }
5144 }
5245}
Original file line number Diff line number Diff line change 11package com .jcabi .github ;
22
3+ import com .jcabi .github .mock .MkGithub ;
34import java .io .IOException ;
4- import java .util .Map ;
55import org .hamcrest .MatcherAssert ;
66import org .hamcrest .Matchers ;
77import org .junit .Test ;
@@ -16,7 +16,13 @@ public class RepositoryStatisticsTest {
1616 public void gathersBasicStatisticsFromRepo () throws IOException {
1717 MatcherAssert .assertThat (
1818 "We expect to have basic statistics from repo" ,
19- new RepositoryStatistics (null ).toMap (),
19+ new RepositoryStatistics (
20+ new MkGithub ()
21+ .repos ()
22+ .create (
23+ new Repos .RepoCreate ("volodya-lombrozo" , false )
24+ )
25+ ).toMap (),
2026 Matchers .allOf (
2127 Matchers .hasKey ("language" ),
2228 Matchers .hasKey ("forks_count" ),
You can’t perform that action at this time.
0 commit comments