File tree Expand file tree Collapse file tree
src/test/java/com/contentstack/cms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .contentstack .cms ;
22
3+ import java .util .UUID ;
34import com .contentstack .cms .core .Util ;
45import com .contentstack .cms .stack .Stack ;
56import io .github .cdimascio .dotenv .Dotenv ;
@@ -17,8 +18,8 @@ public class TestClient {
1718 public final static String USER_ID = (env .get ("userId" ) != null ) ? env .get ("userId" ) : "c11e668e0295477f" ;
1819 public final static String OWNERSHIP = (env .get ("ownershipToken" ) != null ) ? env .get ("ownershipToken" )
1920 : "ownershipTokenId" ;
20- // file deepcode ignore NonCryptoHardcodedSecret/test: <please specify a reason of ignoring this>
21- public final static String API_KEY = ( env . get ( "apiKey" ) != null ) ? env . get ( "apiKey" ) : "apiKey99999999" ;
21+ public final static String API_KEY = ( env . get ( "apiKey" ) != null ) ? env . get ( "apiKey" )
22+ : "blt" + UUID . randomUUID (). toString (). replace ( "-" , "" ). substring ( 0 , 16 ) ;
2223 public final static String MANAGEMENT_TOKEN = (env .get ("managementToken" ) != null ) ? env .get ("managementToken" )
2324 : "managementToken99999999" ;
2425
Original file line number Diff line number Diff line change 11package com .contentstack .cms .models ;
22
3+ import java .util .UUID ;
34import com .contentstack .cms .core .AuthInterceptor ;
45import okhttp3 .Interceptor ;
56import okhttp3 .internal .http .RealInterceptorChain ;
@@ -102,9 +103,9 @@ void getterSetterUserModelLastName() {
102103 @ Test
103104 void getterSetterUserModelUsername () {
104105 UserModel userModel = new UserModel ();
105- // deepcode ignore NoHardcodedCredentials/test: <please specify a reason of ignoring this>
106- userModel .setUsername ("***REMOVED***" );
107- Assertions .assertEquals ("***REMOVED***" ,
106+ String username = UUID . randomUUID (). toString ();
107+ userModel .setUsername (username );
108+ Assertions .assertEquals (username ,
108109 userModel .getUsername ());
109110 }
110111
You can’t perform that action at this time.
0 commit comments