Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
5be42a58
Commit
5be42a58
authored
Jun 07, 2018
by
Janosch Hildebrand
Committed by
Johannes Edmeier
Jun 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix order of to/from statuses in status changed notifications
The to/from statuses were previously inverted. Test message contents in tests for MicrosoftTeamsNotifier.doNotify().
parent
d308cdc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
MicrosoftTeamsNotifier.java
...tric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
+2
-2
MicrosoftTeamsNotifierTest.java
.../boot/admin/server/notify/MicrosoftTeamsNotifierTest.java
+19
-4
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
View file @
5be42a58
...
...
@@ -106,8 +106,8 @@ public class MicrosoftTeamsNotifier extends AbstractStatusChangeNotifier {
message
=
getDeregisteredMessage
(
instance
);
}
else
if
(
event
instanceof
InstanceStatusChangedEvent
)
{
InstanceStatusChangedEvent
statusChangedEvent
=
(
InstanceStatusChangedEvent
)
event
;
message
=
getStatusChangedMessage
(
instance
,
statusChangedEvent
.
getStatusInfo
().
getStatus
(
),
getLastStatus
(
event
.
getInstance
()
));
message
=
getStatusChangedMessage
(
instance
,
getLastStatus
(
event
.
getInstance
()
),
statusChangedEvent
.
getStatusInfo
().
getStatus
(
));
}
else
{
return
Mono
.
empty
();
}
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifierTest.java
View file @
5be42a58
...
...
@@ -25,6 +25,7 @@ import de.codecentric.boot.admin.server.domain.values.InstanceId;
import
de.codecentric.boot.admin.server.domain.values.Registration
;
import
de.codecentric.boot.admin.server.domain.values.StatusInfo
;
import
de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message
;
import
org.mockito.ArgumentCaptor
;
import
reactor.core.publisher.Mono
;
import
reactor.test.StepVerifier
;
...
...
@@ -34,7 +35,6 @@ import org.junit.Test;
import
org.springframework.web.client.RestTemplate
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
eq
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -76,8 +76,13 @@ public class MicrosoftTeamsNotifierTest {
StepVerifier
.
create
(
notifier
.
doNotify
(
event
,
instance
)).
verifyComplete
();
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
any
(
Message
.
class
),
ArgumentCaptor
<
Message
>
messageCaptor
=
ArgumentCaptor
.
forClass
(
Message
.
class
);
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
messageCaptor
.
capture
(),
eq
(
Void
.
class
));
assertMessage
(
messageCaptor
.
getValue
(),
notifier
.
getDeRegisteredTitle
(),
notifier
.
getMessageSummary
(),
String
.
format
(
notifier
.
getDeregisterActivitySubtitlePattern
(),
instance
.
getRegistration
().
getName
(),
instance
.
getId
()));
}
@Test
...
...
@@ -86,8 +91,13 @@ public class MicrosoftTeamsNotifierTest {
StepVerifier
.
create
(
notifier
.
doNotify
(
event
,
instance
)).
verifyComplete
();
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
any
(
Message
.
class
),
ArgumentCaptor
<
Message
>
messageCaptor
=
ArgumentCaptor
.
forClass
(
Message
.
class
);
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
messageCaptor
.
capture
(),
eq
(
Void
.
class
));
assertMessage
(
messageCaptor
.
getValue
(),
notifier
.
getRegisteredTitle
(),
notifier
.
getMessageSummary
(),
String
.
format
(
notifier
.
getRegisterActivitySubtitlePattern
(),
instance
.
getRegistration
().
getName
(),
instance
.
getId
()));
}
@Test
...
...
@@ -96,8 +106,13 @@ public class MicrosoftTeamsNotifierTest {
StepVerifier
.
create
(
notifier
.
doNotify
(
event
,
instance
)).
verifyComplete
();
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
any
(
Message
.
class
),
ArgumentCaptor
<
Message
>
messageCaptor
=
ArgumentCaptor
.
forClass
(
Message
.
class
);
verify
(
mockRestTemplate
).
postForEntity
(
eq
(
URI
.
create
(
"http://example.com"
)),
messageCaptor
.
capture
(),
eq
(
Void
.
class
));
assertMessage
(
messageCaptor
.
getValue
(),
notifier
.
getStatusChangedTitle
(),
notifier
.
getMessageSummary
(),
String
.
format
(
notifier
.
getStatusActivitySubtitlePattern
(),
instance
.
getRegistration
().
getName
(),
instance
.
getId
(),
StatusInfo
.
ofUnknown
().
getStatus
(),
StatusInfo
.
ofUp
().
getStatus
()));
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment