Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ import com.ararahq.arara.sdk.Arara;
// Criar o cliente
Arara arara = Arara.builder()
.apiKey("sua-chave-api-aqui")
.baseUrl("https://api.ararahq.com")
.baseUrl("https://api.ararahq.com/api")
.build();
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Builder
public class AraraConfig {
@Builder.Default
String baseUrl = "https://api.ararahq.com";
String baseUrl = "https://api.ararahq.com/api";

String apiKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ void shouldThrowRateLimitExceptionWithoutRetryAfter() {
void shouldParseNestedErrorEnvelope() {
mockWebServer.enqueue(new MockResponse()
.setResponseCode(400)
.setBody("{\"error\":{\"code\":\"INSUFFICIENT_CREDITS\","
.setBody("{\"error\":{\"code\":\"INSUFFICIENT_FUNDS\","
+ "\"message\":\"Not enough credits\","
+ "\"details\":{\"balance\":0}}}"));

AraraApiException exception = assertThrows(AraraApiException.class,
() -> client.get("test", TestResponse.class));

assertEquals("INSUFFICIENT_CREDITS", exception.getErrorDetails().getCode());
assertEquals("INSUFFICIENT_FUNDS", exception.getErrorDetails().getCode());
assertEquals("Not enough credits", exception.getErrorDetails().getMessage());
assertEquals(0, exception.getErrorDetails().getDetails().get("balance"));
}
Expand Down
Loading