forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoconfig.groovy
29 lines (25 loc) · 883 Bytes
/
autoconfig.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package commands
import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint
class autoconfig {
@Usage("Display auto configuration report from ApplicationContext")
@Command
void main(InvocationContext context) {
context.attributes['spring.beanfactory'].getBeansOfType(AutoConfigurationReportEndpoint.class).each { name, endpoint ->
def report = endpoint.invoke()
out.println "Endpoint: " + name + "\n\nPositive Matches:\n================\n"
report.positiveMatches.each { key, list ->
out.println key + ":"
list.each { mandc ->
out.println " " + mandc.condition + ": " + mandc.message
}
}
out.println "\nNegative Matches\n================\n"
report.negativeMatches.each { key, list ->
out.println key + ":"
list.each { mandc ->
out.println " " + mandc.condition + ": " + mandc.message
}
}
}
}
}