@Test public void shouldRegister() throws Exception { String responseAsString = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<checkout>" + "<code>8CF4BE7DCECEF0F004A6DFA0A8243412</code>" + "<date>2016-11-09T00:00:00.000-03:00</date>" + "</checkout>"; HttpResponse response = new HttpResponse(200, responseAsString); when(httpClient.execute(any(HttpMethod.class), anyString(), anyMap(), any(HttpRequestBody.class))).thenReturn(response); RegisteredCheckout registeredCheckout = checkoutsResource.register(checkoutRegistration); assertEquals("8CF4BE7DCECEF0F004A6DFA0A8243412", registeredCheckout.getCheckoutCode()); assertEquals("https: "8CF4BE7DCECEF0F004A6DFA0A8243412", registeredCheckout.getRedirectURL()); }
public RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder) { return register(checkoutRegistrationBuilder.build()); }
CheckoutsResource { public RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder) { return register(checkoutRegistrationBuilder.build()); } }
CheckoutsResource { public RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder) { return register(checkoutRegistrationBuilder.build()); } CheckoutsResource(PagSeguro pagSeguroAPI, HttpClient httpClient); }
CheckoutsResource { public RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder) { return register(checkoutRegistrationBuilder.build()); } CheckoutsResource(PagSeguro pagSeguroAPI, HttpClient httpClient); RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder); RegisteredCheckout register(CheckoutRegistration checkoutRegistration); }
CheckoutsResource { public RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder) { return register(checkoutRegistrationBuilder.build()); } CheckoutsResource(PagSeguro pagSeguroAPI, HttpClient httpClient); RegisteredCheckout register(Builder<CheckoutRegistration> checkoutRegistrationBuilder); RegisteredCheckout register(CheckoutRegistration checkoutRegistration);  }