66import ch .viascom .groundwork .foxhttp .component .oauth2 .GrantType ;
77import ch .viascom .groundwork .foxhttp .component .oauth2 .OAuth2Component ;
88import ch .viascom .groundwork .foxhttp .component .oauth2 .OAuth2StoreBuilder ;
9- import ch .viascom .groundwork .foxhttp .component .oauth2 .response .OAuthTokenErrorResponse ;
10- import ch .viascom .groundwork .foxhttp .exception .FoxHttpRequestException ;
9+ import ch .viascom .groundwork .foxhttp .interceptor .FoxHttpInterceptorType ;
1110import ch .viascom .groundwork .foxhttp .log .SystemOutFoxHttpLogger ;
1211import ch .viascom .groundwork .foxhttp .models .OAuth2Response ;
1312import ch .viascom .groundwork .foxhttp .parser .GsonParser ;
13+ import ch .viascom .groundwork .foxhttp .response .serviceresult .DefaultServiceResultFaultInterceptor ;
1414import ch .viascom .groundwork .foxhttp .response .serviceresult .FoxHttpServiceResultResponse ;
1515import ch .viascom .groundwork .foxhttp .type .RequestType ;
1616import org .joda .time .DateTime ;
@@ -36,7 +36,7 @@ public class FoxHttpOAuth2Test {
3636 static OAuth2Component oAuth2Component ;
3737 private static String solaraURL = "http://localhost:8080/solara-webservice-1.0-SNAPSHOT" ;
3838 private static String solaraTestUser = "fox@viascom.ch" ;
39- private static String solaraTestPassword = "password1234" ;
39+ private static String solaraTestPassword = "password1234- " ;
4040 private static String solaraClient = "AluxApp/1.0-SNAPSHOT" ;
4141 private static String solaraClientSecret = "7OVm8OeTPf6EZq3C" ;
4242
@@ -45,6 +45,7 @@ public static void prepareTestInstance() throws Exception {
4545 httpClient = new FoxHttpClientBuilder (new GsonParser (), new GsonParser ())
4646 .setFoxHttpLogger (new SystemOutFoxHttpLogger (true , "OAuth2" ))
4747 .addFoxHttpPlaceholderEntry ("solara" , solaraURL )
48+ .registerFoxHttpInterceptor (FoxHttpInterceptorType .RESPONSE ,new DefaultServiceResultFaultInterceptor ())
4849 .build ();
4950
5051
@@ -87,9 +88,6 @@ public static void prepareTestInstance() throws Exception {
8788 oAuth2Component1 .getFoxHttpClient ().getFoxHttpAuthorizationStrategy ().addAuthorization (scope , oAuth2Component1 .getOAuth2Authorization ());
8889 }
8990
90- } else {
91- OAuthTokenErrorResponse tokenErrorResponse = response .getParsedBody (OAuthTokenErrorResponse .class );
92- throw new FoxHttpRequestException (tokenErrorResponse .getError () + " : " + tokenErrorResponse .getErrorDescription ());
9391 }
9492 });
9593 httpClient .activateComponent (oAuth2Component );
0 commit comments