@@ -28,7 +28,8 @@ public class MainTest {
2828
2929 public enum TestRoutes implements RouteImport {
3030 HELLO ("/hello" ),
31- GREET ("greet$name$" )
31+ GREET ("greet$name$" ),
32+ REQUEST_TOKEN ("/auth/request/token" )
3233 ;
3334
3435 final String route ;
@@ -47,7 +48,9 @@ public String getRoute() {
4748 * Example of URL branches, you can add multiple branches if you have multiple environments (dev, prod, etc.)
4849 */
4950 public enum ExampleUrlBranch implements URLProvider {
50- LOCALHOST ("http://localhost:8080" )
51+ LOCALHOST ("http://localhost:8080" ),
52+ POST_PROD ("https://post-prod.systemsolutiongroup.xyz/" ),
53+ PROD ("https://api.safe-project.systemsolutiongroup.xyz/" )
5154 ;
5255
5356 private final String url ;
@@ -64,6 +67,7 @@ public String getURL() {
6467
6568 public enum TestCustomVersion implements VersionProvider {
6669 DEV_BRANCH ("dev" ),
70+ V1_API ("v1/api" )
6771 ;
6872
6973 private final String version ;
@@ -154,4 +158,29 @@ public void testLangType() {
154158 }
155159 }
156160
161+
162+ @ Test
163+ public void testSpecData () {
164+ try {
165+
166+ connectLib .Init (ResourceType .MAIN_RESOURCES , LangType .ENGLISH , TestRoutes .class );
167+
168+ CompletableFuture <ApiFactory > apiFactoryCompletableFuture = connectLib .JobGetInfos ()
169+ .getRoutes (TestCustomVersion .V1_API , MethodType .GET , TestRoutes .REQUEST_TOKEN )
170+ .urlBranch (ExampleUrlBranch .PROD )
171+ .getResponse ();
172+
173+ ApiFactory apiFactory = apiFactoryCompletableFuture .get (5 , TimeUnit .SECONDS );
174+
175+ System .out .println ("Réponse brute: " + apiFactory .display ());
176+
177+ System .out .println ("Data: " + apiFactory .getData ("data" ));
178+
179+ System .out .println (apiFactory .getSpecData ("data" , "accessToken" ));
180+
181+ } catch (Exception e ) {
182+ e .printStackTrace ();
183+ }
184+ }
185+
157186}
0 commit comments