Skip to content

Instantly share code, notes, and snippets.

View snicoll's full-sized avatar
🍃
👨‍💻

Stéphane Nicoll snicoll

🍃
👨‍💻
View GitHub Profile
package org.springframework.web.servlet.mvc.method.annotation;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.annotation.Bean;
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="apc" class="org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator"/>
<bean id="annotationSource" class="org.springframework.cache.jcache.interceptor.DefaultJCacheOperationSource">
<property name="cacheManager" ref="cacheManager"/>
package org.springframework.cache.jcache.config;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
/**
*
* @author Stephane Nicoll
*/
public class JCacheFullConfigTests extends AbstractJCacheAnnotationTests {

UrlPathHelper usage in SPR

OK:

  • PathExtensionContentNegotiationStrategy sets the urlDecode to false
  • WebAsyncManager, DispatcherServlet and NoSuchRequestHandlingMethodException use it only for logging purposes (the latter in a weird way)

Candidate:

@EnableJms
@Configuration
static class EnableJmsConfig {
@Bean
public JmsListenerContainerFactory defaultJmsMJmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(testConnectionFactory());
factory.setDestinationResolver(testDestinationResolver());
factory.setMessageConverter(testMessageConverter());
@EnableJms
@Configuration
static class EnableJmsConfig {
@Bean
public JmsListenerContainerTestFactory defaultJmsListenerContainerFactory() {
return new JmsListenerContainerTestFactory("default");
}
@Bean
@Configuration
@Import(BootstrapHornetQConfig.class)
@EnableJms
static class Config {
@Bean
public DemoService echoService() {
return new DemoService();
}
static class JmsEndpointSampleBean {
private final Map<String, Boolean> invocations = new HashMap<String, Boolean>();
public void resolveMessageAndSession(javax.jms.Message message, Session session) {
invocations.put("resolveMessageAndSession", true);
assertNotNull("Message not injected", message);
assertNotNull("Session not injected", session);
}
[INFO] The following files have been resolved:
[INFO] junit:junit:jar:4.11:test
[INFO] org.springframework.hateoas:spring-hateoas:jar:0.9.0.RELEASE:compile
[INFO] org.springframework:spring-core:jar:4.0.3.RELEASE:compile
[INFO] org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] org.springframework.boot:spring-boot-starter-test:jar:1.0.2.RELEASE:test
[INFO] org.springframework.boot:spring-boot-starter:jar:1.0.2.RELEASE:compile
[INFO] org.slf4j:jul-to-slf4j:jar:1.7.7:compile
[INFO] org.apache.tomcat.embed:tomcat-embed-el:jar:7.0.52:compile
[INFO] org.springframework.data:spring-data-mongodb:jar:1.4.2.RELEASE:compile
@snicoll
snicoll / config-metadata.json
Last active August 29, 2015 14:03
Spring boot actuator metadata file (work in progress)
{"groups": {
"endpoints.autoconfig": {
"type": "org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint",
"items": {
"id": {
"groupType": 0,
"type": "java.lang.String"
},
"sensitive": {
"groupType": 0,