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
403b3258
Commit
403b3258
authored
Mar 06, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong autoconfig order preventing mailNotifier to be instantiated
parent
976619f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
AdminServerAutoConfiguration.java
...oot/admin/server/config/AdminServerAutoConfiguration.java
+1
-1
AdminServerNotifierAutoConfiguration.java
...n/server/config/AdminServerNotifierAutoConfiguration.java
+4
-3
spring.factories
...admin-server/src/main/resources/META-INF/spring.factories
+1
-0
AdminServerNotifierAutoConfigurationTest.java
...rver/config/AdminServerNotifierAutoConfigurationTest.java
+2
-1
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfiguration.java
View file @
403b3258
...
@@ -58,7 +58,7 @@ import org.springframework.core.annotation.Order;
...
@@ -58,7 +58,7 @@ import org.springframework.core.annotation.Order;
@Configuration
@Configuration
@ConditionalOnBean
(
AdminServerMarkerConfiguration
.
Marker
.
class
)
@ConditionalOnBean
(
AdminServerMarkerConfiguration
.
Marker
.
class
)
@EnableConfigurationProperties
(
AdminServerProperties
.
class
)
@EnableConfigurationProperties
(
AdminServerProperties
.
class
)
@Import
({
AdminServerWebConfiguration
.
class
,
AdminServerNotifierConfiguration
.
class
})
@Import
({
AdminServerWebConfiguration
.
class
})
public
class
AdminServerAutoConfiguration
{
public
class
AdminServerAutoConfiguration
{
private
final
AdminServerProperties
adminServerProperties
;
private
final
AdminServerProperties
adminServerProperties
;
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierConfiguration.java
→
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifier
Auto
Configuration.java
View file @
403b3258
...
@@ -50,7 +50,8 @@ import org.springframework.context.annotation.Primary;
...
@@ -50,7 +50,8 @@ import org.springframework.context.annotation.Primary;
import
org.springframework.mail.MailSender
;
import
org.springframework.mail.MailSender
;
@Configuration
@Configuration
public
class
AdminServerNotifierConfiguration
{
@AutoConfigureAfter
({
MailSenderAutoConfiguration
.
class
})
public
class
AdminServerNotifierAutoConfiguration
{
@Configuration
@Configuration
@ConditionalOnBean
(
Notifier
.
class
)
@ConditionalOnBean
(
Notifier
.
class
)
...
@@ -97,12 +98,12 @@ public class AdminServerNotifierConfiguration {
...
@@ -97,12 +98,12 @@ public class AdminServerNotifierConfiguration {
public
NotificationFilterController
notificationFilterController
()
{
public
NotificationFilterController
notificationFilterController
()
{
return
new
NotificationFilterController
(
filteringNotifier
);
return
new
NotificationFilterController
(
filteringNotifier
);
}
}
}
}
@Configuration
@Configuration
@ConditionalOnBean
(
MailSender
.
class
)
@AutoConfigureAfter
({
MailSenderAutoConfiguration
.
class
})
@AutoConfigureBefore
({
NotifierTriggerConfiguration
.
class
,
CompositeNotifierConfiguration
.
class
})
@AutoConfigureBefore
({
NotifierTriggerConfiguration
.
class
,
CompositeNotifierConfiguration
.
class
})
@ConditionalOnBean
(
MailSender
.
class
)
public
static
class
MailNotifierConfiguration
{
public
static
class
MailNotifierConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
...
...
spring-boot-admin-server/src/main/resources/META-INF/spring.factories
View file @
403b3258
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerNotifierAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerDiscoveryAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerDiscoveryAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerHazelcastAutoConfiguration,\
de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration
de.codecentric.boot.admin.server.config.AdminServerCloudFoundryAutoConfiguration
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierConfigurationTest.java
→
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifier
Auto
ConfigurationTest.java
View file @
403b3258
...
@@ -49,7 +49,7 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
...
@@ -49,7 +49,7 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
AdminServerNotifierConfigurationTest
{
public
class
AdminServerNotifier
Auto
ConfigurationTest
{
private
static
final
InstanceEvent
APP_DOWN
=
new
InstanceStatusChangedEvent
(
InstanceId
.
of
(
"id-2"
),
0L
,
private
static
final
InstanceEvent
APP_DOWN
=
new
InstanceStatusChangedEvent
(
InstanceId
.
of
(
"id-2"
),
0L
,
StatusInfo
.
ofDown
());
StatusInfo
.
ofDown
());
...
@@ -152,6 +152,7 @@ public class AdminServerNotifierConfigurationTest {
...
@@ -152,6 +152,7 @@ public class AdminServerNotifierConfigurationTest {
context
.
register
(
RestTemplateAutoConfiguration
.
class
);
context
.
register
(
RestTemplateAutoConfiguration
.
class
);
context
.
register
(
AdminServerMarkerConfiguration
.
class
);
context
.
register
(
AdminServerMarkerConfiguration
.
class
);
context
.
register
(
AdminServerAutoConfiguration
.
class
);
context
.
register
(
AdminServerAutoConfiguration
.
class
);
context
.
register
(
AdminServerNotifierAutoConfiguration
.
class
);
TestPropertyValues
.
of
(
environment
).
applyTo
(
context
);
TestPropertyValues
.
of
(
environment
).
applyTo
(
context
);
context
.
refresh
();
context
.
refresh
();
...
...
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