Merge remote-tracking branch 'origin/master'

This commit is contained in:
slavisa-baeldung 2016-12-08 22:07:49 +01:00
commit d13f274bb3
43 changed files with 609 additions and 537 deletions

View File

@ -0,0 +1,13 @@
package com.baeldung.optional;
public class Modem {
private Double price;
public Modem(Double price) {
this.price = price;
}
public Double getPrice() {
return price;
}
}

View File

@ -1,4 +1,4 @@
package com.baeldung.java_8_features; package com.baeldung.optional;
import java.util.Optional; import java.util.Optional;

View File

@ -33,4 +33,4 @@ public class AsyncEchoTest {
client.stop(); client.stop();
} }
} }

View File

@ -1,17 +1,15 @@
package com.baeldung.java8.optional; package com.baeldung.java8.optional;
import static org.junit.Assert.assertEquals; import com.baeldung.optional.Modem;
import static org.junit.Assert.assertFalse; import com.baeldung.optional.Person;
import static org.junit.Assert.assertTrue; import org.junit.Test;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Optional; import java.util.Optional;
import org.junit.Test; import static org.junit.Assert.*;
import com.baeldung.java_8_features.Person;
public class OptionalTest { public class OptionalTest {
// creating Optional // creating Optional
@ -95,7 +93,40 @@ public class OptionalTest {
boolean is2017 = yearOptional.filter(y -> y == 2017).isPresent(); boolean is2017 = yearOptional.filter(y -> y == 2017).isPresent();
assertFalse(is2017); assertFalse(is2017);
} }
@Test
public void whenFiltersWithoutOptional_thenCorrect() {
assertTrue(priceIsInRange1(new Modem(10.0)));
assertFalse(priceIsInRange1(new Modem(9.9)));
assertFalse(priceIsInRange1(new Modem(null)));
assertFalse(priceIsInRange1(new Modem(15.5)));
assertFalse(priceIsInRange1(null));
}
@Test
public void whenFiltersWithOptional_thenCorrect() {
assertTrue(priceIsInRange2(new Modem(10.0)));
assertFalse(priceIsInRange2(new Modem(9.9)));
assertFalse(priceIsInRange2(new Modem(null)));
assertFalse(priceIsInRange2(new Modem(15.5)));
assertFalse(priceIsInRange1(null));
}
public boolean priceIsInRange1(Modem modem) {
boolean isInRange = false;
if (modem != null && modem.getPrice() != null && (modem.getPrice() >= 10 && modem.getPrice() <= 15)) {
isInRange = true;
}
return isInRange;
}
public boolean priceIsInRange2(Modem modem2) {
return Optional.ofNullable(modem2)
.map(Modem::getPrice)
.filter(p -> p >= 10)
.filter(p -> p <= 15)
.isPresent();
}
// Transforming Value With map() // Transforming Value With map()
@Test @Test
public void givenOptional_whenMapWorks_thenCorrect() { public void givenOptional_whenMapWorks_thenCorrect() {
@ -203,4 +234,4 @@ public class OptionalTest {
System.out.println("Getting default value..."); System.out.println("Getting default value...");
return "Default Value"; return "Default Value";
} }
} }

View File

@ -1,131 +1,123 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>spring-boot</artifactId> <artifactId>spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>Spring Boot Actuator</name> <name>Spring Boot Actuator</name>
<description>This is simple boot application for Spring boot actuator test</description> <description>This is simple boot application for Spring boot actuator test</description>
<!-- Inherit defaults from Spring Boot --> <!-- Inherit defaults from Spring Boot -->
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RC1</version> <version>1.4.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>
<properties> <dependencies>
<!-- The main class to start by executing java -jar --> <dependency>
<start-class>org.baeldung.boot.DemoApplication</start-class> <groupId>org.springframework.boot</groupId>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <artifactId>spring-boot-starter-thymeleaf</artifactId>
<java.version>1.8</java.version> </dependency>
<spring.version>4.3.1.RELEASE</spring.version> <dependency>
</properties> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependencies> <dependency>
<dependency> <groupId>org.springframework.boot</groupId>
<groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>io.dropwizard.metrics</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>metrics-core</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.dropwizard.metrics</groupId> <groupId>com.h2database</groupId>
<artifactId>metrics-core</artifactId> <artifactId>h2</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>h2</artifactId> <artifactId>spring-boot-starter-test</artifactId>
</dependency> <scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter</artifactId>
<scope>test</scope> </dependency>
</dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.subethamail</groupId>
<artifactId>subethasmtp</artifactId>
<version>3.1.7</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.webjars</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>bootstrap</artifactId>
</dependency> <version>3.3.7-1</version>
<dependency> </dependency>
<groupId>com.jayway.jsonpath</groupId> <dependency>
<artifactId>json-path</artifactId> <groupId>org.webjars</groupId>
<scope>test</scope> <artifactId>jquery</artifactId>
</dependency> <version>3.1.1</version>
<dependency> </dependency>
<groupId>org.springframework.boot</groupId> </dependencies>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.subethamail</groupId>
<artifactId>subethasmtp</artifactId>
<version>3.1.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
<build> <build>
<finalName>spring-boot</finalName> <finalName>spring-boot</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<filtering>true</filtering> <filtering>true</filtering>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>pl.project13.maven</groupId> <groupId>pl.project13.maven</groupId>
@ -143,10 +135,10 @@
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile> <profile>
@ -182,42 +174,14 @@
</build> </build>
</profile> </profile>
</profiles> </profiles>
<repositories>
<repository> <properties>
<id>spring-snapshots</id> <!-- The main class to start by executing java -jar -->
<name>Spring Snapshots</name> <start-class>org.baeldung.boot.DemoApplication</start-class>
<url>https://repo.spring.io/snapshot</url> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<snapshots> <java.version>1.8</java.version>
<enabled>true</enabled> <spring.version>4.3.4.RELEASE</spring.version>
</snapshots> </properties>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project> </project>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,13 +22,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-task-starter.version>1.0.3.RELEASE</spring-cloud-task-starter.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId> <artifactId>spring-cloud-task-starter</artifactId>
<version>1.0.1.RELEASE</version> <version>${spring-cloud-task-starter.version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,6 +22,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-dataflow-dependencies.version>1.1.0.RELEASE</spring-cloud-dataflow-dependencies.version>
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
</properties> </properties>
<dependencies> <dependencies>
@ -42,14 +44,14 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-dependencies</artifactId> <artifactId>spring-cloud-dataflow-dependencies</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version> <version>${spring-cloud-dataflow-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version> <version>${spring-cloud-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,6 +22,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-dataflow-dependencies.version>1.1.0.RELEASE</spring-cloud-dataflow-dependencies.version>
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
</properties> </properties>
<dependencies> <dependencies>
@ -42,14 +44,14 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-dependencies</artifactId> <artifactId>spring-cloud-dataflow-dependencies</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version> <version>${spring-cloud-dataflow-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version> <version>${spring-cloud-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,6 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
</properties> </properties>
<dependencies> <dependencies>
@ -42,7 +43,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version> <version>${spring-cloud-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,6 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
</properties> </properties>
<dependencies> <dependencies>
@ -42,7 +43,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version> <version>${spring-cloud-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@ -22,6 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
</properties> </properties>
<dependencies> <dependencies>
@ -42,7 +43,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR5</version> <version>${spring-cloud-dependencies.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -14,43 +14,43 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId> <artifactId>mockito-all</artifactId>
<version>1.10.19</version> <version>${mockito.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>4.2.6.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId> <artifactId>spring-core</artifactId>
<version>4.2.6.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId> <artifactId>spring-beans</artifactId>
<version>4.2.6.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>4.2.6.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.inject</groupId> <groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId> <artifactId>javax.inject</artifactId>
<version>1</version> <version>${javax.inject.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>20.0</version> <version>${guava.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -124,6 +124,11 @@
</profiles> </profiles>
<properties> <properties>
<mockito.version>1.10.19</mockito.version>
<spring.version>4.3.4.RELEASE</spring.version>
<javax.inject.version>1</javax.inject.version>
<junit.version>4.12</junit.version>
<guava.version>20.0</guava.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
</properties> </properties>

View File

@ -14,14 +14,15 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<cucumber.java.version>1.2.4</cucumber.java.version> <cucumber.java.version>1.2.5</cucumber.java.version>
<commons-io.version>1.3.2</commons-io.version>
</properties> </properties>
<dependencies> <dependencies>
@ -68,14 +69,11 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>1.3.2</version> <version>${commons-io.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -130,6 +128,5 @@
</build> </build>
</profile> </profile>
</profiles> </profiles>
</project> </project>

View File

@ -11,19 +11,20 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.data.version>1.3.2.RELEASE</org.springframework.data.version> <org.springframework.data.version>1.3.2.RELEASE</org.springframework.data.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<org.slf4j.version>1.7.12</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<cassandra-driver-core.version>2.1.5</cassandra-driver-core.version> <cassandra-driver-core.version>2.1.5</cassandra-driver-core.version>
<cassandra-unit-spring.version>2.1.9.2</cassandra-unit-spring.version> <cassandra-unit-spring.version>2.1.9.2</cassandra-unit-spring.version>
<cassandra-unit-shaded>2.1.9.2</cassandra-unit-shaded> <cassandra-unit-shaded.version>2.1.9.2</cassandra-unit-shaded.version>
<hector-core.version>2.0-0</hector-core.version> <hector-core.version>2.0-0</hector-core.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <guava.version>19.0</guava.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -39,7 +40,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit-dep</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -64,7 +65,7 @@
<dependency> <dependency>
<groupId>org.cassandraunit</groupId> <groupId>org.cassandraunit</groupId>
<artifactId>cassandra-unit-shaded</artifactId> <artifactId>cassandra-unit-shaded</artifactId>
<version>${cassandra-unit-shaded}</version> <version>${cassandra-unit-shaded.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -103,58 +104,58 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.7</source> <source>1.8</source>
<target>1.7</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*IntegrationTest.java</exclude> <exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>integration</id> <id>integration</id>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<phase>integration-test</phase> <phase>integration-test</phase>
<goals> <goals>
<goal>test</goal> <goal>test</goal>
</goals> </goals>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
</excludes> </excludes>
<includes> <includes>
<include>**/*IntegrationTest.java</include> <include>**/*IntegrationTest.java</include>
</includes> </includes>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<systemPropertyVariables> <systemPropertyVariables>
<test.mime>json</test.mime> <test.mime>json</test.mime>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
</profiles> </profiles>
</project> </project>

View File

@ -1,13 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId> <groupId>org.baeldung</groupId>
<artifactId>spring-data-couchbase-2</artifactId> <artifactId>spring-data-couchbase-2</artifactId>
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
<name>spring-data-couchbase-2</name> <name>spring-data-couchbase-2</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<!-- Spring Context and Couchbase Peristence --> <!-- Spring Context and Couchbase Peristence -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@ -20,9 +21,9 @@
<version>${spring-framework.version}</version> <version>${spring-framework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-couchbase</artifactId> <artifactId>spring-data-couchbase</artifactId>
<version>${spring-data-couchbase.version}</version> <version>${spring-data-couchbase.version}</version>
</dependency> </dependency>
<!-- Hibernate JSR-303 Bean Validation --> <!-- Hibernate JSR-303 Bean Validation -->
@ -45,21 +46,21 @@
<version>${org.slf4j.version}</version> <version>${org.slf4j.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>${logback.version}</version> <version>${logback.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId> <artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j.version}</version> <version>${org.slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId> <artifactId>log4j-over-slf4j</artifactId>
<version>${org.slf4j.version}</version> <version>${org.slf4j.version}</version>
</dependency> </dependency>
<!-- Test-Scoped Dependencies --> <!-- Test-Scoped Dependencies -->
<dependency> <dependency>
@ -74,43 +75,44 @@
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.7</source> <source>1.8</source>
<target>1.7</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version> <version>${maven-surefire-plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*IntegrationTest.java</exclude> <exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude> <exclude>**/*LiveTest.java</exclude>
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties> <properties>
<java.version>1.7</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-framework.version>4.2.4.RELEASE</spring-framework.version> <spring-framework.version>4.3.4.RELEASE</spring-framework.version>
<spring-data-couchbase.version>2.1.1.RELEASE</spring-data-couchbase.version> <spring-data-couchbase.version>2.1.5.RELEASE</spring-data-couchbase.version>
<hibernate-validator.version>5.2.4.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<joda-time.version>2.9.2</joda-time.version> <joda-time.version>2.9.6</joda-time.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<org.slf4j.version>1.7.12</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -11,7 +11,7 @@
<parent> <parent>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<version>1.2.3.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <relativePath/>
</parent> </parent>
@ -20,7 +20,11 @@
<start-class>com.baeldung.Application</start-class> <start-class>com.baeldung.Application</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring.version>4.3.1.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<httpclient.version>4.5.2</httpclient.version>
<spring-data-dynamodb.version>4.4.1</spring-data-dynamodb.version>
<aws-java-sdk-dynamodb.version>1.11.64</aws-java-sdk-dynamodb.version>
<bootstrap.version>3.3.7-1</bootstrap.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -83,23 +87,23 @@
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId> <artifactId>bootstrap</artifactId>
<version>3.3.4</version> <version>${bootstrap.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amazonaws</groupId> <groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId> <artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.11.34</version> <version>${aws-java-sdk-dynamodb.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.derjust</groupId> <groupId>com.github.derjust</groupId>
<artifactId>spring-data-dynamodb</artifactId> <artifactId>spring-data-dynamodb</artifactId>
<version>4.3.1</version> <version>${spring-data-dynamodb.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.2</version> <version>${httpclient.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -14,12 +14,14 @@
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<spring-data-elasticsearch.version>2.0.5.RELEASE</spring-data-elasticsearch.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<org.slf4j.version>1.7.12</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<elasticsearch.version>2.0.1.RELEASE</elasticsearch.version> <jna.version>4.2.2</jna.version>
<elasticsearch.version>2.4.2</elasticsearch.version>
<fastjson.version>1.2.21</fastjson.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
@ -32,12 +34,12 @@
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId> <artifactId>spring-data-elasticsearch</artifactId>
<version>${elasticsearch.version}</version> <version>${spring-data-elasticsearch.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit-dep</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -50,7 +52,7 @@
<dependency> <dependency>
<groupId>net.java.dev.jna</groupId> <groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId> <artifactId>jna</artifactId>
<version>4.1.0</version> <version>${jna.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -78,12 +80,12 @@
<dependency> <dependency>
<groupId>org.elasticsearch</groupId> <groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId> <artifactId>elasticsearch</artifactId>
<version>2.3.5</version> <version>${elasticsearch.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.13</version> <version>${fastjson.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -23,7 +23,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit-dep</artifactId> <artifactId>junit</artifactId>
<version>${junit.version}</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -106,7 +106,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -164,18 +164,19 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.data.version>1.7.1.RELEASE</org.springframework.data.version> <org.springframework.data.version>1.8.6.RELEASE</org.springframework.data.version>
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<querydsl.version>3.6.6</querydsl.version> <querydsl.version>3.7.4</querydsl.version>
<mysema.maven.version>1.1.3</mysema.maven.version> <mysema.maven.version>1.1.3</mysema.maven.version>
<org.slf4j.version>1.7.12</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>

View File

@ -11,8 +11,13 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<neo4j.version>3.0.1</neo4j.version> <neo4j.version>3.0.7</neo4j.version>
<spring-data-neo4j.version>4.1.1.RELEASE</spring-data-neo4j.version> <spring-data-neo4j.version>4.1.5.RELEASE</spring-data-neo4j.version>
<jackson-jsog.version>1.1</jackson-jsog.version>
<spring-boot.version>1.4.2.RELEASE</spring-boot.version>
<spring-test.version>4.3.4.RELEASE</spring-test.version>
<neo4j-ogm-test.version>2.0.5</neo4j-ogm-test.version>
<junit.version>4.12</junit.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
@ -26,14 +31,14 @@
<dependency> <dependency>
<groupId>com.voodoodyne.jackson.jsog</groupId> <groupId>com.voodoodyne.jackson.jsog</groupId>
<artifactId>jackson-jsog</artifactId> <artifactId>jackson-jsog</artifactId>
<version>1.1</version> <version>${jackson-jsog.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<version>1.3.6.RELEASE</version> <version>${spring-boot.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -61,7 +66,7 @@
<dependency> <dependency>
<groupId>org.neo4j</groupId> <groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-test</artifactId> <artifactId>neo4j-ogm-test</artifactId>
<version>2.0.2</version> <version>${neo4j-ogm-test.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -74,12 +79,12 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>4.2.3.RELEASE</version> <version>${spring-test.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -9,9 +9,13 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.2.5.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<spring-data-redis>1.6.2.RELEASE</spring-data-redis> <spring-data-redis>1.7.5.RELEASE</spring-data-redis>
<nosqlunit.version>0.8.0</nosqlunit.version> <cglib.version>3.2.4</cglib.version>
<jedis.version>2.9.0</jedis.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.12</junit.version>
<nosqlunit.version>0.10.0</nosqlunit.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
</properties> </properties>
@ -25,19 +29,19 @@
<dependency> <dependency>
<groupId>cglib</groupId> <groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId> <artifactId>cglib-nodep</artifactId>
<version>2.2</version> <version>${cglib.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.16</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.5.1</version> <version>${jedis.version}</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
@ -56,7 +60,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>

View File

@ -11,9 +11,11 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.2.5.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<spring-data-solr>2.0.4.RELEASE</spring-data-solr> <spring-data-solr.version>2.0.5.RELEASE</spring-data-solr.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.12</junit.version>
</properties> </properties>
<dependencies> <dependencies>
@ -25,7 +27,7 @@
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-solr</artifactId> <artifactId>spring-data-solr</artifactId>
<version>${spring-data-solr}</version> <version>${spring-data-solr.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
@ -35,12 +37,12 @@
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.16</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -18,33 +18,33 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version> <version>${javax.servlet.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
<version>4.3.3.RELEASE</version> <version>${org.springframework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.thymeleaf</groupId> <groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId> <artifactId>thymeleaf-spring4</artifactId>
<version>3.0.2.RELEASE</version> <version>${thymeleaf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.21</version> <version>${org.slf4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.7</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId> <artifactId>log4j-slf4j-impl</artifactId>
<version>2.7</version> <version>${log4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -53,7 +53,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -62,7 +62,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version> <version>${maven-war-plugin.version}</version>
<configuration> <configuration>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
</configuration> </configuration>
@ -70,7 +70,7 @@
<plugin> <plugin>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
<version>9.3.12.v20160915</version> <version>${jetty-maven-plugin.version}</version>
<configuration> <configuration>
<webApp> <webApp>
<contextPath>/</contextPath> <contextPath>/</contextPath>
@ -79,4 +79,22 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<!-- Spring -->
<org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<!-- logging -->
<org.slf4j.version>1.7.21</org.slf4j.version>
<log4j.version>2.7</log4j.version>
<!-- various -->
<javax.servlet.version>3.1.0</javax.servlet.version>
<!-- Maven plugins -->
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>3.0.0</maven-war-plugin.version>
<jetty-maven-plugin.version>9.3.14.v20161028</jetty-maven-plugin.version>
</properties>
</project> </project>

View File

@ -69,7 +69,7 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version> <version>${javax.servlet-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -133,28 +133,28 @@
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>el-api</artifactId> <artifactId>el-api</artifactId>
<version>2.2</version> <version>${javax.el.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.derby</groupId> <groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId> <artifactId>derby</artifactId>
<version>10.12.1.1</version> <version>${derby.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.derby</groupId> <groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId> <artifactId>derbyclient</artifactId>
<version>10.12.1.1</version> <version>${derby.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.derby</groupId> <groupId>org.apache.derby</groupId>
<artifactId>derbynet</artifactId> <artifactId>derbynet</artifactId>
<version>10.12.1.1</version> <version>${derby.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.derby</groupId> <groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId> <artifactId>derbytools</artifactId>
<version>10.12.1.1</version> <version>${derby.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -208,44 +208,46 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.3.2.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.1.1.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<javassist.version>3.20.0-GA</javassist.version> <javassist.version>3.21.0-GA</javassist.version>
<jstl.version>1.2</jstl.version> <jstl.version>1.2</jstl.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<tomcat-dbcp.version>7.0.42</tomcat-dbcp.version> <tomcat-dbcp.version>7.0.73</tomcat-dbcp.version>
<derby.version>10.13.1.1</derby.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<javax.el.version>2.2</javax.el.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<groovy.version>1.8.9</groovy.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -7,9 +7,9 @@ import java.util.Properties;
import org.baeldung.ex.mappingexception.cause4.persistence.model.Foo; import org.baeldung.ex.mappingexception.cause4.persistence.model.Foo;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
import org.junit.Test; import org.junit.Test;
public class Cause4MappingExceptionManualTest { public class Cause4MappingExceptionManualTest {
@ -35,7 +35,7 @@ public class Cause4MappingExceptionManualTest {
configuration.addAnnotatedClass(Foo.class); configuration.addAnnotatedClass(Foo.class);
final ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); final ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
final SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); final SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory; return sessionFactory;
} }

View File

@ -9,12 +9,13 @@
<properties> <properties>
<jdk.version>1.8</jdk.version> <jdk.version>1.8</jdk.version>
<spring.version>4.2.4.RELEASE</spring.version> <spring.version>4.3.4.RELEASE</spring.version>
<freemarker.version>2.3.23</freemarker.version> <freemarker.version>2.3.23</freemarker.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<jcl.slf4j.version>1.7.12</jcl.slf4j.version> <jcl.slf4j.version>1.7.21</jcl.slf4j.version>
<servletapi.version>3.1.0</servletapi.version> <servletapi.version>3.1.0</servletapi.version>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -73,7 +74,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${jdk.version}</source> <source>${jdk.version}</source>
<target>${jdk.version}</target> <target>${jdk.version}</target>

View File

@ -181,42 +181,42 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.4.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<javassist.version>3.20.0-GA</javassist.version> <javassist.version>3.21.0-GA</javassist.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>3.6.10.Final</hibernate.version> <hibernate.version>3.6.10.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<tomcat-dbcp.version>7.0.47</tomcat-dbcp.version> <tomcat-dbcp.version>7.0.73</tomcat-dbcp.version>
<h2.version>1.4.191</h2.version> <h2.version>1.4.193</h2.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -53,11 +53,6 @@
<artifactId>jta</artifactId> <artifactId>jta</artifactId>
<version>${jta.version}</version> <version>${jta.version}</version>
</dependency> </dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>${el-api.version}</version>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
@ -80,7 +75,7 @@
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId> <artifactId>javax.el-api</artifactId>
<version>2.2.5</version> <version>${javax.el-api.version}</version>
</dependency> </dependency>
<!-- utils --> <!-- utils -->
@ -152,7 +147,7 @@
<dependency> <dependency>
<groupId>org.hsqldb</groupId> <groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId> <artifactId>hsqldb</artifactId>
<version>2.3.4</version> <version>${hsqldb.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -199,29 +194,29 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.4.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<org.springframework.data.version>1.9.2.RELEASE</org.springframework.data.version> <org.springframework.data.version>1.10.5.RELEASE</org.springframework.data.version>
<javassist.version>3.20.0-GA</javassist.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version> <hibernate.version>4.3.11.Final</hibernate.version>
<hibernate-envers.version>${hibernate.version}</hibernate-envers.version> <hibernate-envers.version>${hibernate.version}</hibernate-envers.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<tomcat-dbcp.version>8.0.30</tomcat-dbcp.version> <tomcat-dbcp.version>8.5.8</tomcat-dbcp.version>
<jta.version>1.1</jta.version> <jta.version>1.1</jta.version>
<el-api.version>2.2.4</el-api.version> <hsqldb.version>2.3.4</hsqldb.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<javax.el-api.version>2.2.5</javax.el-api.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
@ -234,10 +229,10 @@
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<!-- <hibernate4-maven-plugin.version>1.1.0</hibernate4-maven-plugin.version> --> <!-- <hibernate4-maven-plugin.version>1.1.0</hibernate4-maven-plugin.version> -->
</properties> </properties>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"
> >
<http use-expressions="true"> <http use-expressions="true">

View File

@ -16,9 +16,16 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.2.4.RELEASE</spring.integration.version> <spring.integration.version>4.3.5.RELEASE</spring.integration.version>
<spring-social.version>1.1.4.RELEASE</spring-social.version>
<javax-mail.version>1.4.7</javax-mail.version>
<javax-activation.version>1.1.1</javax-activation.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<junit.version>4.11</junit.version> <junit.version>4.12</junit.version>
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<exec-maven-plugin.version>1.5.0</exec-maven-plugin.version>
</properties> </properties>
<repositories> <repositories>
@ -33,7 +40,7 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version> <version>${maven-eclipse-plugin.version}</version>
<configuration> <configuration>
<additionalProjectnatures> <additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
@ -48,10 +55,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.6</source> <source>1.8</source>
<target>1.6</target> <target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument> <compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>
@ -60,7 +67,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version> <version>${exec-maven-plugin.version}</version>
<configuration> <configuration>
<mainClass>com.baeldung.samples.Main</mainClass> <mainClass>com.baeldung.samples.Main</mainClass>
</configuration> </configuration>
@ -81,18 +88,18 @@
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId> <artifactId>spring-integration-core</artifactId>
<version>4.3.4.RELEASE</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.activation</groupId> <groupId>javax.activation</groupId>
<artifactId>activation</artifactId> <artifactId>activation</artifactId>
<version>1.1.1</version> <version>${javax-activation.version}</version>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.7</version> <version>${javax-mail.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@ -102,32 +109,27 @@
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-twitter</artifactId> <artifactId>spring-integration-twitter</artifactId>
<version>4.3.4.RELEASE</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mail</artifactId> <artifactId>spring-integration-mail</artifactId>
<version>4.3.4.RELEASE</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ftp</artifactId> <artifactId>spring-integration-ftp</artifactId>
<version>4.3.4.RELEASE</version> <version>${spring.integration.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.social</groupId> <groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId> <artifactId>spring-social-core</artifactId>
<version>1.1.4.RELEASE</version> <version>${spring-social.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.integration</groupId> <groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-file</artifactId> <artifactId>spring-integration-file</artifactId>
<version>4.3.4.RELEASE</version> <version>${spring.integration.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -9,9 +9,12 @@
<description>Introduction to Spring JMS</description> <description>Introduction to Spring JMS</description>
<properties> <properties>
<springframework.version>4.3.2.RELEASE</springframework.version> <springframework.version>4.3.4.RELEASE</springframework.version>
<activemq.version>5.12.0</activemq.version> <activemq.version>5.14.1</activemq.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -41,7 +44,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -50,7 +53,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>2.4</version> <version>${maven-war-plugin.version}</version>
<configuration> <configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory> <warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>spring-jms</warName> <warName>spring-jms</warName>

View File

@ -11,7 +11,7 @@
<!-- Import dependency management from Spring Boot --> <!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId> <artifactId>spring-boot-dependencies</artifactId>
<version>1.3.5.RELEASE</version> <version>1.4.2.RELEASE</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -23,14 +23,12 @@
<dependency> <dependency>
<groupId>org.jooq</groupId> <groupId>org.jooq</groupId>
<artifactId>jooq</artifactId> <artifactId>jooq</artifactId>
<version>${org.jooq.version}</version>
</dependency> </dependency>
<!-- Database Access --> <!-- Database Access -->
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>${com.h2database.version}</version>
</dependency> </dependency>
<!-- Spring --> <!-- Spring -->
@ -70,6 +68,11 @@
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -77,7 +80,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId> <artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version> <version>${properties-maven-plugin.version}</version>
<executions> <executions>
<execution> <execution>
<phase>initialize</phase> <phase>initialize</phase>
@ -96,7 +99,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId> <artifactId>sql-maven-plugin</artifactId>
<version>1.5</version> <version>${sql-maven-plugin.version}</version>
<executions> <executions>
<execution> <execution>
<phase>initialize</phase> <phase>initialize</phase>
@ -179,7 +182,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle-mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -244,15 +247,19 @@
</profiles> </profiles>
<properties> <properties>
<org.jooq.version>3.7.3</org.jooq.version> <org.jooq.version>3.8.6</org.jooq.version>
<com.h2database.version>1.4.191</com.h2database.version> <com.h2database.version>1.4.193</com.h2database.version>
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.slf4j.version>1.7.18</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<ch.qos.logback.version>1.1.3</ch.qos.logback.version> <ch.qos.logback.version>1.1.7</ch.qos.logback.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<sql-maven-plugin.version>1.5</sql-maven-plugin.version>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -1,5 +1,10 @@
package com.baeldung.jooq.springboot; package com.baeldung.jooq.springboot;
import static com.baeldung.jooq.introduction.db.public_.tables.Author.AUTHOR;
import static com.baeldung.jooq.introduction.db.public_.tables.AuthorBook.AUTHOR_BOOK;
import static com.baeldung.jooq.introduction.db.public_.tables.Book.BOOK;
import static org.junit.Assert.assertEquals;
import org.jooq.DSLContext; import org.jooq.DSLContext;
import org.jooq.Record3; import org.jooq.Record3;
import org.jooq.Result; import org.jooq.Result;
@ -7,19 +12,14 @@ import org.jooq.impl.DSL;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import static com.baeldung.jooq.introduction.db.public_.tables.Author.AUTHOR; @RunWith(SpringRunner.class)
import static com.baeldung.jooq.introduction.db.public_.tables.AuthorBook.AUTHOR_BOOK; @SpringBootTest(classes = Application.class)
import static com.baeldung.jooq.introduction.db.public_.tables.Book.BOOK;
import static org.junit.Assert.assertEquals;
@SpringApplicationConfiguration(Application.class)
@Transactional("transactionManager") @Transactional("transactionManager")
@RunWith(SpringJUnit4ClassRunner.class)
public class SpringBootIntegrationTest { public class SpringBootIntegrationTest {
@Autowired @Autowired

View File

@ -43,7 +43,7 @@
<dependency> <dependency>
<groupId>xml-apis</groupId> <groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId> <artifactId>xml-apis</artifactId>
<version>1.4.01</version> <version>${xml-apis.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.javassist</groupId> <groupId>org.javassist</groupId>
@ -77,7 +77,7 @@
<dependency> <dependency>
<groupId>javax.el</groupId> <groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId> <artifactId>javax.el-api</artifactId>
<version>2.2.5</version> <version>${javax.el-api.version}</version>
</dependency> </dependency>
<!-- web --> <!-- web -->
@ -196,47 +196,48 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.3.2.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<javassist.version>3.20.0-GA</javassist.version> <javassist.version>3.21.0-GA</javassist.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>5.2.2.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<spring-data-jpa.version>1.10.2.RELEASE</spring-data-jpa.version> <spring-data-jpa.version>1.10.5.RELEASE</spring-data-jpa.version>
<h2.version>1.4.192</h2.version> <h2.version>1.4.193</h2.version>
<!-- web --> <!-- web -->
<javax.servlet.jstl.version>1.2</javax.servlet.jstl.version> <javax.servlet.jstl.version>1.2</javax.servlet.jstl.version>
<javax.servlet.servlet-api.version>2.5</javax.servlet.servlet-api.version> <javax.servlet.servlet-api.version>2.5</javax.servlet.servlet-api.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.3</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<xml-apis.version>1.4.01</xml-apis.version>
<javax.el-api.version>2.2.5</javax.el-api.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<maven-war-plugin.version>2.4</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<!-- <maven-war-plugin.version>2.6</maven-war-plugin.version> -->
</properties> </properties>

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>
@ -61,9 +61,9 @@
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<katharsis.version>1.0.0</katharsis.version> <katharsis.version>1.0.1</katharsis.version>
<restassured.version>2.4.0</restassured.version> <restassured.version>2.9.0</restassured.version>
<cargo-maven2-plugin.version>1.6.0</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -13,7 +13,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
@ -30,7 +30,7 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId> <artifactId>mockito-all</artifactId>
<version>1.10.19</version> <version>${mockito.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -91,6 +91,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<mockito.version>1.10.19</mockito.version>
</properties> </properties>
</project> </project>

View File

@ -11,7 +11,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version> <version>1.4.2.RELEASE</version>
<relativePath></relativePath> <relativePath></relativePath>
</parent> </parent>
@ -24,18 +24,15 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
<version>1.4.0.RELEASE</version>
</dependency> </dependency>
<!-- The following two dependencies included to render jsp pages --> <!-- The following two dependencies included to render jsp pages -->
<dependency> <dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId> <artifactId>tomcat-embed-jasper</artifactId>
<version>8.5.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId> <artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -84,14 +84,14 @@
</profiles> </profiles>
<properties> <properties>
<springframework.version>4.0.6.RELEASE</springframework.version> <springframework.version>4.3.4.RELEASE</springframework.version>
<maven-war-plugin.version>2.4</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<jstl.version>1.2</jstl.version> <jstl.version>1.2</jstl.version>
<javax.servlet.jsp-api.version>2.3.1</javax.servlet.jsp-api.version> <javax.servlet.jsp-api.version>2.3.1</javax.servlet.jsp-api.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version> <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-compiler-plugin.source>1.8</maven-compiler-plugin.source> <maven-compiler-plugin.source>1.8</maven-compiler-plugin.source>
<hibernate-validator.version>5.1.1.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<deploy-path>enter-location-of-server</deploy-path> <deploy-path>enter-location-of-server</deploy-path>
</properties> </properties>

View File

@ -47,13 +47,13 @@
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version> <version>${javax.servlet-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId> <artifactId>jstl</artifactId>
<version>1.2</version> <version>${jstl.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
@ -78,7 +78,7 @@
<dependency> <dependency>
<groupId>commons-fileupload</groupId> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <artifactId>commons-fileupload</artifactId>
<version>1.3.1</version> <version>${commons-fileupload.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sourceforge.htmlunit</groupId> <groupId>net.sourceforge.htmlunit</groupId>
@ -150,7 +150,7 @@
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>2.2.0</version> <version>${jsonpath.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -184,7 +184,7 @@
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.7</version> <version>${maven-resources-plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
@ -250,42 +250,46 @@
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.3.4.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<thymeleaf.version>2.1.4.RELEASE</thymeleaf.version> <thymeleaf.version>2.1.5.RELEASE</thymeleaf.version>
<jackson.version>2.7.8</jackson.version> <jackson.version>2.8.5</jackson.version>
<!-- persistence --> <!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version> <hibernate.version>5.2.5.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version> <mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.21</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.5</logback.version> <logback.version>1.1.7</logback.version>
<!-- various --> <!-- various -->
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version> <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<jstl.version>1.2</jstl.version>
<!-- util --> <!-- util -->
<guava.version>19.0</guava.version> <guava.version>19.0</guava.version>
<commons-lang3.version>3.4</commons-lang3.version> <commons-lang3.version>3.5</commons-lang3.version>
<commons-fileupload.version>1.3.2</commons-fileupload.version>
<jsonpath.version>2.2.0</jsonpath.version>
<!-- testing --> <!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version> <org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version> <httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5</httpclient.version> <httpclient.version>4.5.2</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version> <rest-assured.version>2.9.0</rest-assured.version>
<net.sourceforge.htmlunit>2.23</net.sourceforge.htmlunit> <net.sourceforge.htmlunit>2.23</net.sourceforge.htmlunit>
<!-- maven plugins --> <!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version> <maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version> <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<!-- AspectJ --> <!-- AspectJ -->
<aspectj.version>1.8.7</aspectj.version> <aspectj.version>1.8.9</aspectj.version>
</properties> </properties>
</project> </project>

View File

@ -2,6 +2,11 @@ package com.baeldung.htmlunit;
import java.util.List; import java.util.List;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlHeading1; import com.gargoylesoftware.htmlunit.html.HtmlHeading1;
@ -9,34 +14,31 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage;
public class HtmlUnitWebScraping { public class HtmlUnitWebScraping {
private WebClient webClient; private WebClient webClient;
@Before @Before
public void init() throws Exception { public void init() throws Exception {
webClient = new WebClient(); webClient = new WebClient();
} }
@After @After
public void close() throws Exception { public void close() throws Exception {
webClient.close(); webClient.close();
} }
@Test @Test
public void givenBaeldungArchive_whenRetrievingArticle_thenHasH1() public void givenBaeldungArchive_whenRetrievingArticle_thenHasH1() throws Exception {
throws Exception { webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setCssEnabled(false); webClient.getOptions().setJavaScriptEnabled(false);
webClient.getOptions().setJavaScriptEnabled(false);
String url = "http://www.baeldung.com/full_archive"; final String url = "http://www.baeldung.com/full_archive";
HtmlPage page = webClient.getPage(url); final HtmlPage page = webClient.getPage(url);
String xpath = "(//ul[@class='car-monthlisting']/li)[1]/a"; final String xpath = "(//ul[@class='car-monthlisting']/li)[1]/a";
HtmlAnchor latestPostLink final HtmlAnchor latestPostLink = (HtmlAnchor) page.getByXPath(xpath).get(0);
= (HtmlAnchor) page.getByXPath(xpath).get(0); final HtmlPage postPage = latestPostLink.click();
HtmlPage postPage = latestPostLink.click();
List<HtmlHeading1> h1 final List<HtmlHeading1> h1 = (List<HtmlHeading1>) postPage.getByXPath("//h1");
= (List<HtmlHeading1>) postPage.getByXPath("//h1");
Assert.assertTrue(h1.size() > 0); Assert.assertTrue(h1.size() > 0);
} }
} }

View File

@ -32,7 +32,7 @@ public class GreetControllerIntegrationTest {
private MockMvc mockMvc; private MockMvc mockMvc;
private static final String CONTENT_TYPE = "application/json"; private static final String CONTENT_TYPE = "application/json;charset=UTF-8";
@Before @Before
public void setup() throws Exception { public void setup() throws Exception {
@ -41,7 +41,7 @@ public class GreetControllerIntegrationTest {
@Test @Test
public void givenWAC_whenServletContext_thenItProvidesGreetController() { public void givenWAC_whenServletContext_thenItProvidesGreetController() {
ServletContext servletContext = wac.getServletContext(); final ServletContext servletContext = wac.getServletContext();
Assert.assertNotNull(servletContext); Assert.assertNotNull(servletContext);
Assert.assertTrue(servletContext instanceof MockServletContext); Assert.assertTrue(servletContext instanceof MockServletContext);
Assert.assertNotNull(wac.getBean("greetController")); Assert.assertNotNull(wac.getBean("greetController"));
@ -54,7 +54,7 @@ public class GreetControllerIntegrationTest {
@Test @Test
public void givenGreetURI_whenMockMVC_thenVerifyResponse() throws Exception { public void givenGreetURI_whenMockMVC_thenVerifyResponse() throws Exception {
MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/greet")).andDo(print()).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.jsonPath("$.message").value("Hello World!!!")).andReturn(); final MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.get("/greet")).andDo(print()).andExpect(MockMvcResultMatchers.status().isOk()).andExpect(MockMvcResultMatchers.jsonPath("$.message").value("Hello World!!!")).andReturn();
Assert.assertEquals(CONTENT_TYPE, mvcResult.getResponse().getContentType()); Assert.assertEquals(CONTENT_TYPE, mvcResult.getResponse().getContentType());
} }

View File

@ -16,7 +16,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
public class GreetControllerUnitTest { public class GreetControllerUnitTest {
private MockMvc mockMvc; private MockMvc mockMvc;
private static final String CONTENT_TYPE = "application/json"; private static final String CONTENT_TYPE = "application/json;charset=UTF-8";
@Before @Before
public void setup() { public void setup() {

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"
> >
<http use-expressions="true"> <http use-expressions="true">