-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0d9259
commit fba7ab9
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/integration/java/org/arkecosystem/client/api/CommitsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.arkecosystem.client.api; | ||
|
||
import org.arkecosystem.client.BaseClientTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.hasKey; | ||
|
||
@SuppressWarnings("unchecked") | ||
public class CommitsIntegrationTest extends BaseClientTest { | ||
|
||
@Test | ||
void show() throws IOException { | ||
Map<String, Object> actual = connection.api().commits.show(123456); | ||
assertThat(actual, hasKey("data")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.arkecosystem.client.api; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
import org.arkecosystem.client.http.Client; | ||
|
||
public class Commits { | ||
private final Client client; | ||
|
||
public Commits(Client client) { | ||
this.client = client; | ||
} | ||
|
||
public Map<String, Object> show(int height) throws IOException { | ||
return this.client.get("commits/" + height); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/java/org/arkecosystem/client/api/CommitsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.arkecosystem.client.api; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
import org.arkecosystem.client.Connection; | ||
import org.arkecosystem.client.MockHelper; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CommitsTest { | ||
|
||
@Test | ||
void show() throws IOException { | ||
Connection connection = MockHelper.connection(); | ||
Map<String, Object> actual = connection.api().commits.show(123456); | ||
assertTrue((boolean) actual.get("success")); | ||
} | ||
} |