Skip to content

Commit

Permalink
EPMRPP-89281 || Fix class cast issue (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbortnik authored Jan 30, 2024
1 parent e4f0e11 commit 98ef8ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
SCRIPTS_VERSION: 5.11.0
BOM_VERSION: 5.11.1
MIGRATIONS_VERSION: 5.11.0
RELEASE_VERSION: 5.11.3
RELEASE_VERSION: 5.11.4

jobs:
release:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private List<Long> searchTestItemIdsByConditions(Long projectId, JSONObject sear
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) {
for (LinkedHashMap<String, Object> hit : hits) {
Map<String, Object> source = (Map<String, Object>) hit.get("_source");
Long testItemId = (Long) source.get("itemId");
Long testItemId = getLongValue(source.get("itemId"));
testItemIds.add(testItemId);
}

Expand Down Expand Up @@ -250,10 +250,10 @@ private LogMessage convertElasticDataToLogMessage(Long projectId, Map<String, Ob
timestampString += "." + "0".repeat(6);
}

return new LogMessage((Long) source.get("id"),
return new LogMessage(getLongValue(source.get("id")),
LocalDateTime.parse(timestampString, DateTimeFormatter.ofPattern(ELASTIC_DATETIME_FORMAT)),
(String) source.get("message"), (Long) source.get("itemId"),
(Long) source.get("launchId"), projectId
(String) source.get("message"), getLongValue(source.get("itemId")),
getLongValue(source.get("launchId")), projectId
);
}

Expand Down Expand Up @@ -359,4 +359,8 @@ private HttpEntity<String> getStringHttpEntity(String body) {
return new HttpEntity<>(body, headers);
}

private Long getLongValue(Object longVal) {
return Long.valueOf((String) longVal);
}

}

0 comments on commit 98ef8ef

Please sign in to comment.