org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint源码实例Demo

类org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint源码实例Demo

下面列出了org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ssh-shell-spring-boot   文件: ActuatorCommand.java
public ActuatorCommand(ApplicationContext applicationContext, Environment environment,
                       SshShellProperties properties, SshShellHelper helper,
                       @Lazy AuditEventsEndpoint audit, @Lazy BeansEndpoint beans,
                       @Lazy ConditionsReportEndpoint conditions,
                       @Lazy ConfigurationPropertiesReportEndpoint configprops, @Lazy EnvironmentEndpoint env,
                       @Lazy HealthEndpoint health,
                       @Lazy HttpTraceEndpoint httptrace, @Lazy InfoEndpoint info, @Lazy LoggersEndpoint loggers,
                       @Lazy MetricsEndpoint metrics,
                       @Lazy MappingsEndpoint mappings, @Lazy ScheduledTasksEndpoint scheduledtasks,
                       @Lazy ShutdownEndpoint shutdown,
                       @Lazy ThreadDumpEndpoint threaddump) {
    this.applicationContext = applicationContext;
    this.environment = environment;
    this.properties = properties;
    this.helper = helper;
    this.audit = audit;
    this.beans = beans;
    this.conditions = conditions;
    this.configprops = configprops;
    this.env = env;
    this.health = health;
    this.httptrace = httptrace;
    this.info = info;
    this.loggers = loggers;
    this.metrics = metrics;
    this.mappings = mappings;
    this.scheduledtasks = scheduledtasks;
    this.shutdown = shutdown;
    this.threaddump = threaddump;
}
 
@SuppressWarnings("unchecked")
@Test
@Ignore
public void testSerializationWithNonStringValues() {
	StaticApplicationContext context = new StaticApplicationContext();
	DefaultListableBeanFactory bf = (DefaultListableBeanFactory) context
			.getBeanFactory();
	BindingServiceProperties bindingServiceProperties = new BindingServiceProperties();
	bindingServiceProperties.setApplicationContext(context);
	bf.registerSingleton("bindingServiceProperties", bindingServiceProperties);

	BindingServiceProperties bsp = context.getBean(BindingServiceProperties.class);
	bsp.setApplicationContext(context);
	BinderProperties bp = new BinderProperties();
	bsp.setBinders(Collections.singletonMap("testBinder", bp));
	bp.getEnvironment().put("spring.rabbitmq.connection-timeout", 2345);
	bp.getEnvironment().put("foo", Collections.singletonMap("bar", "hello"));

	// using Spring Boot class to ensure that reliance on the same ObjectMapper
	// configuration
	ConfigurationPropertiesReportEndpoint endpoint = new ConfigurationPropertiesReportEndpoint();
	endpoint.setApplicationContext(context);

	ContextConfigurationProperties configurationProperties = endpoint
			.configurationProperties().getContexts().values().iterator().next();

	Map<String, Object> properties = configurationProperties.getBeans()
			.get("bindingServiceProperties").getProperties();
	assertThat(properties.containsKey("error")).isFalse();
	assertThat(properties.containsKey("binders")).isTrue();
	Map<String, Object> testBinder = (Map<String, Object>) ((Map<String, Object>) properties
			.get("binders")).get("testBinder");
	Map<String, Object> environment = (Map<String, Object>) testBinder
			.get("environment");
	assertThat(
			environment.get("spring.rabbitmq.connection-timeout") instanceof Integer)
					.isTrue();
	assertThat(environment.get("foo") instanceof Map).isTrue();
}
 
源代码3 项目: ssh-shell-spring-boot   文件: ActuatorCommand.java
/**
 * Config props method
 *
 * @return configprops
 */
@ShellMethod(key = "configprops", value = "Display configprops endpoint.")
@ShellMethodAvailability("configpropsAvailability")
public ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties configprops() {
    return configprops.configurationProperties();
}
 
源代码4 项目: ssh-shell-spring-boot   文件: ActuatorCommand.java
/**
 * @return whether `configprops` command is available
 */
public Availability configpropsAvailability() {
    return availability("configprops", ConfigurationPropertiesReportEndpoint.class);
}
 
ConfigurationPropertiesReportCommand(ConfigurationPropertiesReportEndpoint confPropsReportEndpoint,
        @Value("${sshd.system.command.roles.configurationPropertiesReport}") String[] systemRoles) {
    super(systemRoles);
    this.confPropsReportEndpoint = confPropsReportEndpoint;
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法