use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class SpringBootConfigurationTests method proxyBeanMethodsCanBeDisabled.
@Test
void proxyBeanMethodsCanBeDisabled() {
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(NoBeanMethodProxyingSpringBootConfiguration.class, Configuration.class);
assertThat(attributes.get("proxyBeanMethods")).isEqualTo(false);
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class ServletComponentScanRegistrar method getPackagesToScan.
private Set<String> getPackagesToScan(AnnotationMetadata metadata) {
AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(ServletComponentScan.class.getName()));
String[] basePackages = attributes.getStringArray("basePackages");
Class<?>[] basePackageClasses = attributes.getClassArray("basePackageClasses");
Set<String> packagesToScan = new LinkedHashSet<>(Arrays.asList(basePackages));
for (Class<?> basePackageClass : basePackageClasses) {
packagesToScan.add(ClassUtils.getPackageName(basePackageClass));
}
if (packagesToScan.isEmpty()) {
packagesToScan.add(ClassUtils.getPackageName(metadata.getClassName()));
}
return packagesToScan;
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class ServletComponentHandler method extractInitParameters.
protected final Map<String, String> extractInitParameters(Map<String, Object> attributes) {
Map<String, String> initParameters = new HashMap<>();
for (AnnotationAttributes initParam : (AnnotationAttributes[]) attributes.get("initParams")) {
String name = (String) initParam.get("name");
String value = (String) initParam.get("value");
initParameters.put(name, value);
}
return initParameters;
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class SpringBootApplicationTests method proxyBeanMethodsCanBeDisabled.
@Test
void proxyBeanMethodsCanBeDisabled() {
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(NoBeanMethodProxyingSpringBootApplication.class, Configuration.class);
assertThat(attributes.get("proxyBeanMethods")).isEqualTo(false);
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class SpringBootApplicationTests method proxyBeanMethodsIsEnabledByDefault.
@Test
void proxyBeanMethodsIsEnabledByDefault() {
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(DefaultSpringBootApplication.class, Configuration.class);
assertThat(attributes.get("proxyBeanMethods")).isEqualTo(true);
}
Aggregations