nacx requested changes on this pull request.
This looks great @andreaturli! Just a few final comments.
> @@ -107,6 +107,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.labs</groupId>
+ <artifactId>cloudsigma2</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ </dependency>
Remove this
> @@ -50,12 +56,7 @@ protected void bindErrorHandlers() {
@Override
protected void bindRetryHandlers() {
-
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(BackoffLimitedRetryHandler.class);
+
bind(HttpRetryHandler.class).annotatedWith(ServerError.class).to(BackoffLimitedRetryHandler.class);
This is [the default
handler](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/http/handlers/DelegatingRetryHandler.java#L56)
bound for server errors, so there is no need to override this method to set it.
> @@ -43,8 +43,6 @@ public void handleError(HttpCommand command, HttpResponse
> response) {
message = message != null ? message : String.format("%s -> %s",
command.getCurrentRequest().getRequestLine(),
response.getStatusLine());
switch (response.getStatusCode()) {
- case 400:
- break;
If we don't handle this, we will propagate a generic `HttpResponseException`
for bad requests. The common pattern is to handle it and encapsulate it in an
`IllealArgumentException`.
>
- assertEquals(size(projects), 1);
+ assertEquals(size(projects), 1);
assertEquals(server.getRequestCount(), 1);
assertSent(server, "GET", "/projects");
}
Change the test to something like
[this](https://github.com/jclouds/jclouds/blob/master/providers/digitalocean2/src/test/java/org/jclouds/digitalocean2/features/ActionApiMockTest.java#L37-L48),
to also verify that pagination works.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/340#pullrequestreview-16103425