Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Kevin Gilmore 2016-12-06 20:59:00 -06:00
commit aae63d1685
26 changed files with 227 additions and 188 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,38 @@ 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)));
}
@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)));
}
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 +232,4 @@ public class OptionalTest {
System.out.println("Getting default value..."); System.out.println("Getting default value...");
return "Default Value"; return "Default Value";
} }
} }

View File

@ -15,9 +15,8 @@ public class Author extends Person {
List<Item> items = new ArrayList<>(); List<Item> items = new ArrayList<>();
public Author(){ public Author(){}
super();
}
public Author(String firstName, String lastName) { public Author(String firstName, String lastName) {
super(firstName, lastName); super(firstName, lastName);
} }

View File

@ -19,9 +19,7 @@ public class Book extends Item {
private Date published; private Date published;
private BigDecimal pages; private BigDecimal pages;
public Book() { public Book() {}
super();
}
public Book(String title, Author author) { public Book(String title, Author author) {
super(title, author); super(title, author);

View File

@ -18,9 +18,7 @@ public class Author extends Person {
private List<Item> items = new ArrayList<>(); private List<Item> items = new ArrayList<>();
public Author(){ public Author(){}
super();
}
public Author(String firstName, String lastName) { public Author(String firstName, String lastName) {
super(firstName, lastName); super(firstName, lastName);

View File

@ -19,9 +19,7 @@ public class Book extends Item {
private Date published; private Date published;
private BigDecimal pages; private BigDecimal pages;
public Book(){ public Book(){}
super();
}
public Book(String title, Author author) { public Book(String title, Author author) {
super(title, author); super(title, author);

View File

@ -32,7 +32,6 @@ public class JacksonInjectTest {
// assert // assert
assertThat(author.getId()).isEqualTo(id); assertThat(author.getId()).isEqualTo(id);
/* /*
{ {
"firstName": "Alex", "firstName": "Alex",

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

@ -27,14 +27,14 @@
<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>
@ -144,28 +144,31 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.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>
<!-- 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> <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<httpclient.version>4.5</httpclient.version> <jstl.version>1.2</jstl.version>
<httpcore.version>4.4.5</httpcore.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-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

@ -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

@ -9,8 +9,14 @@
<description>Integrating Spring MVC with Apache Tiles</description> <description>Integrating Spring MVC with Apache Tiles</description>
<properties> <properties>
<springframework.version>4.3.2.RELEASE</springframework.version> <springframework.version>4.3.4.RELEASE</springframework.version>
<apachetiles.version>3.0.5</apachetiles.version> <apache-tiles.version>3.0.7</apache-tiles.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<javax.servlet.jsp-api.version>2.3.1</javax.servlet.jsp-api.version>
<jstl.version>1.2</jstl.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>
@ -34,24 +40,24 @@
<dependency> <dependency>
<groupId>org.apache.tiles</groupId> <groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId> <artifactId>tiles-jsp</artifactId>
<version>${apachetiles.version}</version> <version>${apache-tiles.version}</version>
</dependency> </dependency>
<!-- Servlet+JSP+JSTL --> <!-- Servlet+JSP+JSTL -->
<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-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId> <artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version> <version>${javax.servlet.jsp-api.version}</version>
</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>
</dependency> </dependency>
</dependencies> </dependencies>
@ -62,16 +68,16 @@
<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.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-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-mvc-tiles</warName> <warName>spring-mvc-tiles</warName>

View File

@ -38,20 +38,20 @@
<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-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.velocity</groupId> <groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId> <artifactId>velocity</artifactId>
<version>1.7</version> <version>${velocity.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.velocity</groupId> <groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId> <artifactId>velocity-tools</artifactId>
<version>2.0</version> <version>${velocity-tools.version}</version>
</dependency> </dependency>
<!-- test scoped --> <!-- test scoped -->
@ -188,26 +188,29 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.1.4.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.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>
<powermock.version>1.6.4</powermock.version> <powermock.version>1.6.6</powermock.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.4.1</rest-assured.version> <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<velocity.version>1.7</velocity.version>
<velocity-tools.version>2.0</velocity-tools.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-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

@ -10,7 +10,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.6.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>
@ -94,7 +94,6 @@
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.5.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -118,7 +117,7 @@
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
<artifactId>easymock</artifactId> <artifactId>easymock</artifactId>
<version>3.4</version> <version>${easymock.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -158,7 +157,6 @@
<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>
<configuration> <configuration>
<excludes> <excludes>
<exclude>**/*IntegrationTest.java</exclude> <exclude>**/*IntegrationTest.java</exclude>
@ -206,42 +204,11 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.3.1.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>
<javassist.version>3.20.0-GA</javassist.version>
<jstl.version>1.2</jstl.version>
<!-- persistence -->
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.2.2.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> <easymock.version>3.4</easymock.version>
<!-- testing -->
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<httpcore.version>4.4.1</httpcore.version>
<httpclient.version>4.5</httpclient.version>
<rest-assured.version>2.9.0</rest-assured.version>
<!-- maven plugins -->
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
<cargo-maven2-plugin.version>1.4.18</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -28,21 +28,21 @@
<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>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>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId> <artifactId>hibernate-validator</artifactId>
<version>5.1.1.Final</version> <version>${hibernate-validator.version}</version>
</dependency> </dependency>
<!-- logging --> <!-- logging -->
@ -110,12 +110,12 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.2</version> <version>${commons-io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.maxmind.geoip2</groupId> <groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId> <artifactId>geoip2</artifactId>
<version>2.8.0</version> <version>${geoip2.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -165,29 +165,45 @@
<properties> <properties>
<!-- Spring --> <!-- Spring -->
<org.springframework.version>4.2.5.RELEASE</org.springframework.version> <org.springframework.version>4.3.4.RELEASE</org.springframework.version>
<jackson.version>2.7.8</jackson.version> <org.springframework.security.version>4.2.0.RELEASE</org.springframework.security.version>
<!-- persistence -->
<hibernate.version>5.2.5.Final</hibernate.version>
<mysql-connector-java.version>5.1.40</mysql-connector-java.version>
<!-- http -->
<httpcore.version>4.4.5</httpcore.version>
<httpclient.version>4.5.2</httpclient.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> <!-- do not upgrade - see http://jira.qos.ch/browse/LOGBACK-851 -->
<!-- various -->
<hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<jstl.version>1.2</jstl.version>
<javax.servlet.version>3.1.0</javax.servlet.version>
<jackson.version>2.8.5</jackson.version>
<!-- util -->
<guava.version>19.0</guava.version>
<commons-lang3.version>3.5</commons-lang3.version>
<commons-io.version>2.5</commons-io.version>
<geoip2.version>2.8.0</geoip2.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>
<httpclient.version>4.5</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-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> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
<cargo-maven2-plugin.version>1.4.18</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>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -5,23 +5,28 @@
<artifactId>spring-protobuf</artifactId> <artifactId>spring-protobuf</artifactId>
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
<name>spring-protobuf</name> <name>spring-protobuf</name>
<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.2.4.RELEASE</version> <version>1.4.2.RELEASE</version>
</parent> </parent>
<properties>
<protobuf-java.version>3.1.0</protobuf-java.version>
<protobuf-java-format.version>1.4</protobuf-java-format.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
<version>3.0.0-beta-3</version> <version>${protobuf-java.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.protobuf-java-format</groupId> <groupId>com.googlecode.protobuf-java-format</groupId>
<artifactId>protobuf-java-format</artifactId> <artifactId>protobuf-java-format</artifactId>
<version>1.4</version> <version>${protobuf-java-format.version}</version>
</dependency> </dependency>
<dependency> <dependency>