File tree Expand file tree Collapse file tree
main/java/com/ost/services
test/java/com/ost/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [ OST JAVA SDK v2.1.0] ( https://github.com/ostdotcom/ost-sdk-java/tree/v2.0.0 )
2+ ---
3+
4+ * Added base tokens module to V2 API's
5+
16[ OST JAVA SDK v2.0.0] ( https://github.com/ostdotcom/ost-sdk-java/tree/v2.0.0 )
27---
38
Original file line number Diff line number Diff line change 1+ package com .ost .services ;
2+
3+ import com .google .gson .JsonObject ;
4+ import com .ost .lib .OSTRequestClient ;
5+
6+ import java .io .IOException ;
7+ import java .util .Map ;
8+
9+ public class BaseTokens extends OSTAPIService {
10+ private static String servicePrefix = "/base-tokens" ;
11+ private static String serviceSuffix = "" ;
12+
13+
14+ public BaseTokens (OSTRequestClient ostRequestClient ) {
15+ super (ostRequestClient , servicePrefix , serviceSuffix );
16+ }
17+
18+ /**
19+ * Get base token details
20+ * @param params Request Params
21+ * @return API Response
22+ */
23+ public JsonObject get ( Map <String ,Object > params ) throws MissingParameter , IOException {
24+ String resource = this .urlPrefix + "/" ;
25+ return this .request .get (resource , params );
26+ }
27+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class Manifest extends OSTServiceManifest {
1515 public RecoveryOwners recoveryOwners ;
1616 public Devices devices ;
1717 public Chains chains ;
18+ public BaseTokens baseTokens ;
1819
1920
2021 public Manifest ( Map <String , Object > params ) {
@@ -34,6 +35,7 @@ protected void init() {
3435 this .recoveryOwners = new RecoveryOwners ( this .request );
3536 this .devices = new Devices ( this .request );
3637 this .chains = new Chains ( this .request );
38+ this .baseTokens = new BaseTokens ( this .request );
3739 }
3840
3941}
Original file line number Diff line number Diff line change 1+ package com .ost .services ;
2+
3+ import com .google .gson .JsonObject ;
4+ import org .junit .Before ;
5+ import org .junit .Test ;
6+
7+ import java .util .HashMap ;
8+
9+ public class BaseTokensTest extends ServiceTestBase {
10+ @ Override
11+ public BaseTokens getService () {
12+ return (BaseTokens ) super .getService ();
13+ }
14+
15+ @ Before
16+ @ Override
17+ public void setUp () throws Exception {
18+ super .setUp ();
19+ setService (getServiceManifest ().baseTokens );
20+ }
21+
22+ @ Override
23+ public Manifest getServiceManifest () {
24+ return (Manifest ) super .getServiceManifest ();
25+ }
26+
27+ @ Test
28+ public void get () throws Exception {
29+ HashMap <String , Object > params = new HashMap <String , Object >();
30+
31+ // Test-Case: Get a Base Token.
32+ JsonObject response ;
33+ response = getService ().get (params );
34+ validateResponseWithSuccess (response );
35+
36+ }
37+
38+ }
You can’t perform that action at this time.
0 commit comments