Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 40 - Update Spring Boot and camel to latest versions #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ buildscript {
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE")
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE")
}
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'spring-boot'
apply plugin: 'org.springframework.boot'

jar {
baseName = 'camel-boot'
Expand All @@ -35,8 +35,8 @@ repositories {
}
}

def springBootVersion = '1.3.1.RELEASE'
def camelVersion = '2.16.2'
def springBootVersion = '1.4.3.RELEASE'
def camelVersion = '2.18.1'

sourceSets {
integrationTest {
Expand Down Expand Up @@ -80,21 +80,22 @@ dependencies {
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
compile(group: 'org.springframework.boot', name: 'spring-boot-starter-jetty', version: springBootVersion)
compile(group: 'com.netflix.hystrix', name: 'hystrix-metrics-event-stream', version: '1.3.16')
compile(group: 'com.netflix.hystrix', name: 'hystrix-core', version: '1.5.8')
compile(group: 'com.netflix.hystrix', name: 'hystrix-metrics-event-stream', version: '1.5.8')
compile(group: 'com.netflix.hystrix', name: 'hystrix-javanica', version: '1.5.8')
compile(group: 'ch.qos.logback', name: 'logback-access', version: '1.1.6')
compile(group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.6')
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.7')
compile(group: 'com.bealetech', name: 'metrics-statsd', version: '3.0.0-CAPGEMINI')
compile(group: 'com.bealetech', name: 'metrics-statsd', version: '3.0.2')
compile(group: 'com.capgemini', name: 'codahale-metrics-filters', version: '0.11.0')
compile(group: 'com.capgemini', name: 'springboot-camel-metrics-publisher', version: '0.12.0')
compile(group: 'com.capgemini', name: 'archaius-spring-adapter', version: '0.10.2')
compile(group: 'com.capgemini', name: 'jetty-server-request-logger', version: '0.9.0')

testCompile(group: 'junit', name: 'junit', version: '4.11')
testCompile(group: 'junit', name: 'junit', version: '4.12')
testCompile(group: 'com.jayway.restassured', name: 'rest-assured', version: '2.4.1')
testCompile(group: 'org.apache.camel', name: 'camel-test-spring', version: camelVersion)
testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion)
testCompile(group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0') // TODO: this is a duplicate
}


Expand All @@ -106,4 +107,4 @@ configurations {

springBoot {
mainClass = 'org.apache.camel.spring.boot.FatJarRouter'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;

import com.capgemini.brahma.Application;
import com.jayway.restassured.RestAssured;

import static com.jayway.restassured.RestAssured.when;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT;

/**
* An example integraiton test which uses RESTAssured.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebIntegrationTest("server.port:1111")
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment= DEFINED_PORT)
public class RouteIntegrationTests {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/capgemini/brahma/config/MyAppConfig.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.capgemini.brahma.config;

import com.capgemini.archaius.spring.ArchaiusBridgePropertyPlaceholderConfigurer;
import com.codahale.metrics.MetricRegistry;
import org.apache.camel.CamelContext;
import org.apache.camel.component.properties.PropertiesComponent;
import org.apache.camel.spring.boot.CamelContextConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;

Expand All @@ -24,7 +26,7 @@ public class MyAppConfig {
* @return the camel context
*/
@Bean
CamelContextConfiguration contextConfiguration() {
CamelContextConfiguration contextConfiguration(MetricRegistry metricRegistry) {
return new CamelContextConfiguration() {
@Override
public void beforeApplicationStart(CamelContext context) {
Expand All @@ -37,6 +39,10 @@ public void beforeApplicationStart(CamelContext context) {
context.setAllowUseOriginalMessage(Boolean.FALSE);
}
}

@Override
public void afterApplicationStart(CamelContext camelContext) {
}
};
}

Expand All @@ -46,6 +52,7 @@ public void beforeApplicationStart(CamelContext context) {
* @return the configurer
*/
@Bean
@Primary
public ArchaiusBridgePropertyPlaceholderConfigurer bridgePropertyPlaceholder() {

ArchaiusBridgePropertyPlaceholderConfigurer configurer = new ArchaiusBridgePropertyPlaceholderConfigurer();
Expand Down