-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
We recently noticed that the DatafeedLoop was crashing with `500` errors returned from Agent. This is something we initially stated that we did not wanted to retry on this specific status. Now we do, as it has actually been raised by some customers.
- Loading branch information
Showing
5 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...-http/symphony-bdk-http-api/src/test/java/com/symphony/bdk/http/api/ApiExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.symphony.bdk.http.api; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class ApiExceptionTest { | ||
|
||
@Test | ||
void isServerError() { | ||
assertFalse(new ApiException(499, "An error").isServerError()); | ||
assertTrue(new ApiException(500, "Internal Server Error").isServerError()); | ||
assertTrue(new ApiException(502, "Bad Gateway").isServerError()); | ||
assertTrue(new ApiException(503, "Service Unavailable").isServerError()); | ||
} | ||
|
||
@Test | ||
void isUnauthorized() { | ||
assertTrue(new ApiException(401, "Unauthorized").isUnauthorized()); | ||
} | ||
|
||
@Test | ||
void isClientError() { | ||
assertTrue(new ApiException(400, "Bad Request").isClientError()); | ||
} | ||
|
||
@Test | ||
void isTooManyRequestsError() { | ||
assertTrue(new ApiException(429, "Too Many Requests").isTooManyRequestsError()); | ||
} | ||
} |