10 changed files with 107 additions and 68 deletions
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
/* |
||||
* Copyright 2014 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.autoconfigure.integration; |
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.integration.config.EnableIntegration; |
||||
|
||||
/** |
||||
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration Auto-configuration} |
||||
* for Spring Integration. |
||||
* |
||||
* @author Artem Bilan |
||||
* @since 1.1 |
||||
*/ |
||||
@Configuration |
||||
@ConditionalOnClass(EnableIntegration.class) |
||||
public class IntegrationAutoConfiguration { |
||||
|
||||
@Configuration |
||||
@EnableIntegration |
||||
protected static class IntegrationConfiguration { |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
/* |
||||
* Copyright 2014 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.autoconfigure.integration; |
||||
|
||||
import static org.junit.Assert.*; |
||||
|
||||
import org.junit.Test; |
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
||||
import org.springframework.integration.support.channel.HeaderChannelRegistry; |
||||
|
||||
/** |
||||
* @author Artem Bilan |
||||
* @since 1.1 |
||||
*/ |
||||
public class IntegrationAutoConfigurationTests { |
||||
|
||||
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); |
||||
|
||||
@Test |
||||
public void integrationIsAvailable() { |
||||
this.context.register(IntegrationAutoConfiguration.class); |
||||
this.context.refresh(); |
||||
assertNotNull(this.context.getBean(HeaderChannelRegistry.class)); |
||||
this.context.close(); |
||||
} |
||||
|
||||
} |
||||
@ -1,39 +0,0 @@
@@ -1,39 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2014 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.boot.groovy; |
||||
|
||||
import java.lang.annotation.Documented; |
||||
import java.lang.annotation.ElementType; |
||||
import java.lang.annotation.Retention; |
||||
import java.lang.annotation.RetentionPolicy; |
||||
import java.lang.annotation.Target; |
||||
|
||||
import org.springframework.boot.cli.compiler.autoconfigure.SpringIntegrationCompilerAutoConfiguration; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.context.annotation.ImportResource; |
||||
|
||||
/** |
||||
* Pseudo annotation used to trigger {@link SpringIntegrationCompilerAutoConfiguration}. |
||||
*/ |
||||
@Target(ElementType.TYPE) |
||||
@Documented |
||||
@Retention(RetentionPolicy.RUNTIME) |
||||
@Configuration |
||||
@ImportResource("classpath:/org/springframework/boot/groovy/integration.xml") |
||||
public @interface EnableIntegrationPatterns { |
||||
|
||||
} |
||||
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd |
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> |
||||
|
||||
<int:annotation-config /> |
||||
|
||||
</beans> |
||||
Loading…
Reference in new issue