@Test public void shouldThrowsBadRequestOnRegister() throws Exception { try { String responseAsString = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<errors>" + "<error>" + "<code>11064</code>" + "<message>" + "redirectURL must have the same domain as applicationURL." + "</message>" + "</error>" + "</errors>"; HttpResponse response = new HttpResponse(400, responseAsString); when(httpClient.execute(any(HttpMethod.class), anyString(), anyMap(), any(HttpRequestBody.class))).thenReturn(response); authorizationsResource.register(authorizationRegistration); } catch (PagSeguroBadRequestException e) { ServerErrors errors = e.getErrors(); ServerError error = errors.getErrors().iterator().next(); assertEquals(new Integer(11064), error.getCode()); assertEquals("redirectURL must have the same domain as applicationURL.", error.getMessage()); } catch (Exception e) { } }
public RegisteredAuthorization register( Builder<AuthorizationRegistration> authorizationRegistrationBuilder) { return register(authorizationRegistrationBuilder.build()); }
AuthorizationsResource { public RegisteredAuthorization register( Builder<AuthorizationRegistration> authorizationRegistrationBuilder) { return register(authorizationRegistrationBuilder.build()); } }
AuthorizationsResource { public RegisteredAuthorization register( Builder<AuthorizationRegistration> authorizationRegistrationBuilder) { return register(authorizationRegistrationBuilder.build()); } AuthorizationsResource(PagSeguro pagSeguro, HttpClient httpClient); }
AuthorizationsResource { public RegisteredAuthorization register( Builder<AuthorizationRegistration> authorizationRegistrationBuilder) { return register(authorizationRegistrationBuilder.build()); } AuthorizationsResource(PagSeguro pagSeguro, HttpClient httpClient); RegisteredAuthorization register(
        Builder<AuthorizationRegistration> authorizationRegistrationBuilder); RegisteredAuthorization register(AuthorizationRegistration authorizationRegistration); RegisteredAuthorization registerWithSuggestion(AuthorizationRegistration authorizationRegistration); AuthorizationSearchResource search(); }
AuthorizationsResource { public RegisteredAuthorization register( Builder<AuthorizationRegistration> authorizationRegistrationBuilder) { return register(authorizationRegistrationBuilder.build()); } AuthorizationsResource(PagSeguro pagSeguro, HttpClient httpClient); RegisteredAuthorization register(
        Builder<AuthorizationRegistration> authorizationRegistrationBuilder); RegisteredAuthorization register(AuthorizationRegistration authorizationRegistration); RegisteredAuthorization registerWithSuggestion(AuthorizationRegistration authorizationRegistration); AuthorizationSearchResource search();  }