Skip to content

Commit 4586a85

Browse files
committed
Fix NoHttpMessageConverter error in ms teams notifier
1 parent 9bf54c3 commit 4586a85

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected void doNotify(ClientApplicationEvent event) throws Exception {
9292
return;
9393
}
9494

95-
this.restTemplate.postForObject(webhookUrl, message, Void.class);
95+
this.restTemplate.postForEntity(webhookUrl, message, Void.class);
9696
}
9797

9898
@Override

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void test_onClientApplicationDeRegisteredEvent_resolve() throws Exception
5151

5252
notifier.doNotify(event);
5353

54-
verify(mockRestTemplate).postForObject(eq(URI.create("http://example.com")),
54+
verify(mockRestTemplate).postForEntity(eq(URI.create("http://example.com")),
5555
any(Message.class), eq(Void.class));
5656
}
5757

@@ -61,7 +61,7 @@ public void test_onApplicationRegisteredEvent_resolve() throws Exception {
6161

6262
notifier.doNotify(event);
6363

64-
verify(mockRestTemplate).postForObject(eq(URI.create("http://example.com")),
64+
verify(mockRestTemplate).postForEntity(eq(URI.create("http://example.com")),
6565
any(Message.class), eq(Void.class));
6666
}
6767

@@ -72,7 +72,7 @@ public void test_onApplicationStatusChangedEvent_resolve() throws Exception {
7272

7373
notifier.doNotify(event);
7474

75-
verify(mockRestTemplate).postForObject(eq(URI.create("http://example.com")),
75+
verify(mockRestTemplate).postForEntity(eq(URI.create("http://example.com")),
7676
any(Message.class), eq(Void.class));
7777
}
7878

0 commit comments

Comments
 (0)