Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
10da3d39
Commit
10da3d39
authored
Mar 27, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
80194bd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
MailHealthIndicatorTests.java
...amework/boot/actuate/health/MailHealthIndicatorTests.java
+3
-2
AutoConfigurationReportLoggingInitializer.java
...re/logging/AutoConfigurationReportLoggingInitializer.java
+3
-0
ClasspathLoggingApplicationListener.java
...ork/boot/logging/ClasspathLoggingApplicationListener.java
+3
-0
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+6
-5
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/MailHealthIndicatorTests.java
View file @
10da3d39
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
actuate
.
health
;
package
org
.
springframework
.
boot
.
actuate
.
health
;
import
java.util.Properties
;
import
java.util.Properties
;
import
javax.mail.Address
;
import
javax.mail.Address
;
import
javax.mail.Message
;
import
javax.mail.Message
;
import
javax.mail.MessagingException
;
import
javax.mail.MessagingException
;
...
@@ -28,7 +29,6 @@ import javax.mail.URLName;
...
@@ -28,7 +29,6 @@ import javax.mail.URLName;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
@@ -72,7 +72,8 @@ public class MailHealthIndicatorTests {
...
@@ -72,7 +72,8 @@ public class MailHealthIndicatorTests {
@Test
@Test
public
void
smtpIsDown
()
throws
MessagingException
{
public
void
smtpIsDown
()
throws
MessagingException
{
doThrow
(
new
MessagingException
(
"A test exception"
)).
when
(
this
.
mailSender
).
testConnection
();
doThrow
(
new
MessagingException
(
"A test exception"
)).
when
(
this
.
mailSender
)
.
testConnection
();
Health
health
=
this
.
indicator
.
health
();
Health
health
=
this
.
indicator
.
health
();
assertEquals
(
Status
.
DOWN
,
health
.
getStatus
());
assertEquals
(
Status
.
DOWN
,
health
.
getStatus
());
assertEquals
(
"smtp.acme.org:25"
,
health
.
getDetails
().
get
(
"location"
));
assertEquals
(
"smtp.acme.org:25"
,
health
.
getDetails
().
get
(
"location"
));
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializer.java
View file @
10da3d39
...
@@ -189,6 +189,9 @@ public class AutoConfigurationReportLoggingInitializer implements
...
@@ -189,6 +189,9 @@ public class AutoConfigurationReportLoggingInitializer implements
@Override
@Override
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
Class
<?>
type
=
resolvableType
.
getRawClass
();
Class
<?>
type
=
resolvableType
.
getRawClass
();
if
(
type
==
null
)
{
return
false
;
}
return
ContextRefreshedEvent
.
class
.
isAssignableFrom
(
type
)
return
ContextRefreshedEvent
.
class
.
isAssignableFrom
(
type
)
||
ApplicationFailedEvent
.
class
.
isAssignableFrom
(
type
);
||
ApplicationFailedEvent
.
class
.
isAssignableFrom
(
type
);
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java
View file @
10da3d39
...
@@ -68,6 +68,9 @@ public final class ClasspathLoggingApplicationListener implements
...
@@ -68,6 +68,9 @@ public final class ClasspathLoggingApplicationListener implements
@Override
@Override
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
Class
<?>
type
=
resolvableType
.
getRawClass
();
Class
<?>
type
=
resolvableType
.
getRawClass
();
if
(
type
==
null
)
{
return
false
;
}
return
ApplicationStartedEvent
.
class
.
isAssignableFrom
(
type
)
return
ApplicationStartedEvent
.
class
.
isAssignableFrom
(
type
)
||
ApplicationFailedEvent
.
class
.
isAssignableFrom
(
type
);
||
ApplicationFailedEvent
.
class
.
isAssignableFrom
(
type
);
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
10da3d39
...
@@ -117,8 +117,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
...
@@ -117,8 +117,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
@Override
@Override
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
public
boolean
supportsEventType
(
ResolvableType
resolvableType
)
{
Class
<?>
eventType
=
resolvableType
.
getRawClass
();
return
isAssignableFrom
(
resolvableType
.
getRawClass
(),
EVENT_TYPES
);
return
isAssignableFrom
(
eventType
,
EVENT_TYPES
);
}
}
@Override
@Override
...
@@ -127,9 +126,11 @@ public class LoggingApplicationListener implements GenericApplicationListener {
...
@@ -127,9 +126,11 @@ public class LoggingApplicationListener implements GenericApplicationListener {
}
}
private
boolean
isAssignableFrom
(
Class
<?>
type
,
Class
<?>...
supportedTypes
)
{
private
boolean
isAssignableFrom
(
Class
<?>
type
,
Class
<?>...
supportedTypes
)
{
for
(
Class
<?>
supportedType
:
supportedTypes
)
{
if
(
type
!=
null
)
{
if
(
supportedType
.
isAssignableFrom
(
type
))
{
for
(
Class
<?>
supportedType
:
supportedTypes
)
{
return
true
;
if
(
supportedType
.
isAssignableFrom
(
type
))
{
return
true
;
}
}
}
}
}
return
false
;
return
false
;
...
...
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