11package com .skyflow ;
22
33import com .skyflow .config .BaseCredentials ;
4+ import com .skyflow .config .BaseVaultConfig ;
45import com .skyflow .errors .ErrorMessage ;
56import com .skyflow .errors .SkyflowException ;
67import com .skyflow .utils .BaseConstants ;
@@ -35,15 +36,15 @@ public void restoreEnvFile() throws IOException {
3536 }
3637 }
3738
38- private BaseVaultClient <Object > newClient (BaseCredentials commonCredentials ) {
39- return new BaseVaultClient <>(new Object (), commonCredentials );
39+ private BaseVaultClient <BaseVaultConfig > newClient (BaseCredentials commonCredentials ) {
40+ return new BaseVaultClient <>(new BaseVaultConfig (), commonCredentials );
4041 }
4142
4243 @ Test
4344 public void testPrioritiseCredentials_prefersVaultSpecificCredentials () throws SkyflowException {
4445 BaseCredentials vaultSpecific = new BaseCredentials ();
4546 vaultSpecific .setApiKey ("test_api_key" );
46- BaseVaultClient <Object > client = newClient (null );
47+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
4748
4849 client .prioritiseCredentials (vaultSpecific );
4950
@@ -54,7 +55,7 @@ public void testPrioritiseCredentials_prefersVaultSpecificCredentials() throws S
5455 public void testPrioritiseCredentials_fallsBackToCommonCredentials () throws SkyflowException {
5556 BaseCredentials common = new BaseCredentials ();
5657 common .setApiKey ("common_api_key" );
57- BaseVaultClient <Object > client = newClient (common );
58+ BaseVaultClient <BaseVaultConfig > client = newClient (common );
5859
5960 client .prioritiseCredentials (null );
6061
@@ -65,7 +66,7 @@ public void testPrioritiseCredentials_fallsBackToCommonCredentials() throws Skyf
6566 public void testPrioritiseCredentials_credentialChange_resetsTokenAndApiKey () throws SkyflowException {
6667 BaseCredentials credentialsA = new BaseCredentials ();
6768 credentialsA .setToken ("x.eyJleHAiOjk5OTk5OTk5OTl9.y" );
68- BaseVaultClient <Object > client = newClient (null );
69+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
6970
7071 client .prioritiseCredentials (credentialsA );
7172 client .token = "cached-token" ;
@@ -83,7 +84,7 @@ public void testPrioritiseCredentials_credentialChange_resetsTokenAndApiKey() th
8384 public void testSetBearerToken_withApiKey () throws SkyflowException {
8485 BaseCredentials creds = new BaseCredentials ();
8586 creds .setApiKey ("sky-ab123-abcd1234cdef1234abcd4321cdef4321" );
86- BaseVaultClient <Object > client = newClient (null );
87+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
8788
8889 client .setBearerToken (creds );
8990
@@ -94,7 +95,7 @@ public void testSetBearerToken_withApiKey() throws SkyflowException {
9495 public void testSetBearerToken_generatesTokenWhenNull () throws SkyflowException {
9596 BaseCredentials creds = new BaseCredentials ();
9697 creds .setToken ("x.eyJleHAiOjk5OTk5OTk5OTl9.y" );
97- BaseVaultClient <Object > client = newClient (null );
98+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
9899
99100 client .setBearerToken (creds );
100101
@@ -105,7 +106,7 @@ public void testSetBearerToken_generatesTokenWhenNull() throws SkyflowException
105106 public void testSetBearerToken_reusesValidNonExpiredToken () throws SkyflowException {
106107 BaseCredentials creds = new BaseCredentials ();
107108 creds .setToken ("x.eyJleHAiOjk5OTk5OTk5OTl9.y" );
108- BaseVaultClient <Object > client = newClient (null );
109+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
109110
110111 // First call: token=null → generates from creds.getToken()
111112 client .setBearerToken (creds );
@@ -118,7 +119,7 @@ public void testSetBearerToken_reusesValidNonExpiredToken() throws SkyflowExcept
118119
119120 @ Test
120121 public void testSetBearerToken_noCredentials_throwsEmptyCredentials () {
121- BaseVaultClient <Object > client = newClient (null );
122+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
122123 try {
123124 client .setBearerToken (null );
124125 Assert .fail ("Should have thrown SkyflowException" );
@@ -137,7 +138,7 @@ public void testPrioritiseCredentials_dotenvReturnsCredentials_setsCredentials()
137138 fw .write (BaseConstants .ENV_CREDENTIALS_KEY_NAME + "={\" token\" :\" env-token-value\" }\n " );
138139 }
139140
140- BaseVaultClient <Object > client = newClient (null );
141+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
141142 client .prioritiseCredentials (null );
142143
143144 Assert .assertNotNull (client .finalCredentials );
@@ -154,7 +155,7 @@ public void testPrioritiseCredentials_dotenvKeyMissing_throwsSkyflowException()
154155 fw .write ("SOME_OTHER_KEY=some_value\n " );
155156 }
156157
157- BaseVaultClient <Object > client = newClient (null );
158+ BaseVaultClient <BaseVaultConfig > client = newClient (null );
158159 try {
159160 client .prioritiseCredentials (null );
160161 Assert .fail ("Should have thrown SkyflowException" );
0 commit comments