Skip to content

Commit

Permalink
ADM-708:[backend]refactor: update get board info exception message (#906
Browse files Browse the repository at this point in the history
)
  • Loading branch information
weiraneve authored Jan 11, 2024
2 parents 6bf9394 + e511237 commit ed736db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@AllArgsConstructor
@Data
@Builder
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class JiraBoardProject {
public class JiraBoardProject implements Serializable {

private String style;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public BoardConfigDTO getInfo(BoardType boardType, BoardRequestParam boardReques
}
catch (RuntimeException e) {
Throwable cause = Optional.ofNullable(e.getCause()).orElse(e);
log.error("Failed to call Jira to get board config, project key: {}, board id: {}, e: {}",
log.error("Failed to call Jira to get board info, project key: {}, board id: {}, e: {}",
boardRequestParam.getBoardId(), boardRequestParam.getProjectKey(), cause.getMessage());
if (cause instanceof BaseException baseException) {
throw baseException;
}
throw new InternalServerErrorException(
String.format("Failed to call Jira to get board config, cause is %s", cause.getMessage()));
String.format("Failed to call Jira to get board info, cause is %s", cause.getMessage()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ void shouldCallJiraFeignClientAndThrowNonColumnWhenGetJiraBoardInfo() {
jiraService.getInfo(boardTypeJira, boardRequestParam);
});
assertThat(thrown).isInstanceOf(InternalServerErrorException.class)
.hasMessageContaining("Failed to call Jira to get board config, cause is");
.hasMessageContaining("Failed to call Jira to get board info, cause is");
}

@Test
Expand Down

0 comments on commit ed736db

Please sign in to comment.