@@ -136,7 +136,7 @@ internal static string GenerateAuthHeader(HttpTestRequest request, BombardierOpt
136136 return authHeader ;
137137 }
138138
139- internal static string GetOauth2AuthenticationHeader ( Dictionary < AuthenticationType , string > accessTokens , AuthenticationType authenticationType )
139+ private static string GetOauth2AuthenticationHeader ( Dictionary < AuthenticationType , string > accessTokens , AuthenticationType authenticationType )
140140 {
141141 string authHeader ;
142142 if ( accessTokens . ContainsKey ( authenticationType ) )
@@ -146,13 +146,13 @@ internal static string GetOauth2AuthenticationHeader(Dictionary<AuthenticationTy
146146 }
147147 else
148148 {
149- throw new Exception ( "One of the access token is missing." ) ;
149+ throw new Exception ( $ "One of the access token is missing (AuthenticationType { authenticationType . Value ( ) } required) .") ;
150150 }
151151
152152 return authHeader ;
153153 }
154154
155- internal static string GetBasicAuthenticationHeader ( BombardierOptions bombardierOptions )
155+ private static string GetBasicAuthenticationHeader ( BombardierOptions bombardierOptions )
156156 {
157157 string authHeader ;
158158
@@ -164,13 +164,13 @@ internal static string GetBasicAuthenticationHeader(BombardierOptions bombardier
164164 }
165165 else
166166 {
167- authHeader = String . Empty ;
167+ throw new Exception ( $ "User name and password for basic authentication are missing and are required)." ) ;
168168 }
169169
170170 return authHeader ;
171171 }
172172
173- internal static string GetApiKeyAuthenticationHeader ( BombardierOptions bombardierOptions )
173+ private static string GetApiKeyAuthenticationHeader ( BombardierOptions bombardierOptions )
174174 {
175175 string authHeader ;
176176
@@ -180,7 +180,7 @@ internal static string GetApiKeyAuthenticationHeader(BombardierOptions bombardie
180180 }
181181 else
182182 {
183- authHeader = String . Empty ;
183+ throw new Exception ( $ "Api Key is missing and is required." ) ;
184184 }
185185
186186 return authHeader ;
0 commit comments