File tree Expand file tree Collapse file tree 4 files changed +58
-1
lines changed
integration/java/org/arkecosystem/client/api
main/java/org/arkecosystem/client/api
test/java/org/arkecosystem/client/api Expand file tree Collapse file tree 4 files changed +58
-1
lines changed Original file line number Diff line number Diff line change
1
+ package org .arkecosystem .client .api ;
2
+
3
+ import org .arkecosystem .client .BaseClientTest ;
4
+ import org .junit .jupiter .api .Test ;
5
+
6
+ import java .io .IOException ;
7
+ import java .util .Map ;
8
+
9
+ import static org .hamcrest .MatcherAssert .assertThat ;
10
+ import static org .hamcrest .Matchers .hasKey ;
11
+
12
+ @ SuppressWarnings ("unchecked" )
13
+ public class CommitsIntegrationTest extends BaseClientTest {
14
+
15
+ @ Test
16
+ void show () throws IOException {
17
+ Map <String , Object > actual = connection .api ().commits .show (123456 );
18
+ assertThat (actual , hasKey ("data" ));
19
+ }
20
+ }
Original file line number Diff line number Diff line change 3
3
import org .arkecosystem .client .http .Client ;
4
4
5
5
public class Api {
6
-
7
6
public final Blockchain blockchain ;
8
7
public final Blocks blocks ;
9
8
public final Delegates delegates ;
@@ -15,6 +14,7 @@ public class Api {
15
14
public final Votes votes ;
16
15
public final Wallets wallets ;
17
16
public final ApiNodes apiNodes ;
17
+ public final Commits commits ;
18
18
19
19
public Api (Client client ) {
20
20
this .blockchain = new Blockchain (client );
@@ -28,5 +28,6 @@ public Api(Client client) {
28
28
this .votes = new Votes (client );
29
29
this .wallets = new Wallets (client );
30
30
this .apiNodes = new ApiNodes (client );
31
+ this .commits = new Commits (client );
31
32
}
32
33
}
Original file line number Diff line number Diff line change
1
+ package org .arkecosystem .client .api ;
2
+
3
+ import java .io .IOException ;
4
+ import java .util .Map ;
5
+ import org .arkecosystem .client .http .Client ;
6
+
7
+ public class Commits {
8
+ private final Client client ;
9
+
10
+ public Commits (Client client ) {
11
+ this .client = client ;
12
+ }
13
+
14
+ public Map <String , Object > show (int height ) throws IOException {
15
+ return this .client .get ("commits/" + height );
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ package org .arkecosystem .client .api ;
2
+
3
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
4
+
5
+ import java .io .IOException ;
6
+ import java .util .Map ;
7
+ import org .arkecosystem .client .Connection ;
8
+ import org .arkecosystem .client .MockHelper ;
9
+ import org .junit .jupiter .api .Test ;
10
+
11
+ public class CommitsTest {
12
+
13
+ @ Test
14
+ void show () throws IOException {
15
+ Connection connection = MockHelper .connection ();
16
+ Map <String , Object > actual = connection .api ().commits .show (123456 );
17
+ assertTrue ((boolean ) actual .get ("success" ));
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments