Skip to content

Commit

Permalink
Renaming CleverClientException method
Browse files Browse the repository at this point in the history
  • Loading branch information
sashirestela committed Dec 14, 2024
1 parent 31b1c0a commit f7dcf6a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static void showTitle(String title) {

private static void handleException(Exception e) {
System.out.println(e.getMessage());
CleverClientException.bringOut(e)
CleverClientException.getFrom(e)
.ifPresentOrElse(
cce -> cce.responseInfo()
.ifPresentOrElse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Optional<HttpResponseInfo> responseInfo() {
return Optional.ofNullable(responseInfo);
}

public static Optional<CleverClientException> bringOut(Throwable exception) {
public static Optional<CleverClientException> getFrom(Throwable exception) {
if (exception instanceof CleverClientException) {
return Optional.of((CleverClientException) exception);
} else if (exception.getCause() instanceof CleverClientException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void shouldBringOutTheCleverClientExceptionIfItExists() {
{ new Exception("No CleverClientException"), false }
};
for (Object[] data : testData) {
var optionalException = CleverClientException.bringOut((Throwable) data[0]);
var optionalException = CleverClientException.getFrom((Throwable) data[0]);
var expectedCondition = (boolean) data[1];
var actualCondition = optionalException.isPresent();
assertEquals(expectedCondition, actualCondition);
Expand Down

0 comments on commit f7dcf6a

Please sign in to comment.