Skip to content

Commit bc95ed5

Browse files
fix(#4551): adds missing identifierType=alias to the OpsGenie close URL (#4557)
Co-authored-by: Stephan Köninger <[email protected]>
1 parent 7c317a0 commit bc95ed5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected Mono<Void> doNotify(InstanceEvent event, Instance instance) {
118118
protected String buildUrl(InstanceEvent event, Instance instance) {
119119
if ((event instanceof InstanceStatusChangedEvent statusChangedEvent)
120120
&& (StatusInfo.STATUS_UP.equals(statusChangedEvent.getStatusInfo().getStatus()))) {
121-
return String.format("%s/%s/close", url, generateAlias(instance));
121+
return String.format("%s/%s/close?identifierType=alias", url, generateAlias(instance));
122122
}
123123
return url.toString();
124124
}

spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifierTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ void test_onApplicationEvent_resolve() {
8181
.notify(new InstanceStatusChangedEvent(INSTANCE.getId(), INSTANCE.getVersion() + 2, StatusInfo.ofUp())))
8282
.verifyComplete();
8383

84-
verify(restTemplate).exchange("https://api.opsgenie.com/v2/alerts/App_-id-/close", HttpMethod.POST,
85-
expectedRequest("DOWN", "UP"), Void.class);
84+
verify(restTemplate).exchange("https://api.opsgenie.com/v2/alerts/App_-id-/close?identifierType=alias",
85+
HttpMethod.POST, expectedRequest("DOWN", "UP"), Void.class);
8686
}
8787

8888
@Test

0 commit comments

Comments
 (0)