Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #84 from paypal/develop
Browse files Browse the repository at this point in the history
Bringing in 2.3.4-RELEASE changes to master
  • Loading branch information
fabiocarvalho777 authored Nov 6, 2017
2 parents 21aafad + fb5b56c commit 5df623d
Show file tree
Hide file tree
Showing 18 changed files with 179 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ test-output/
.idea/
*.iml

release_steps.txt
.DS_Store
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add the Maven dependency below to your Spring Boot application pom file.<br>
<dependency>
<groupId>com.paypal.springboot</groupId>
<artifactId>resteasy-spring-boot-starter</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<scope>runtime</scope>
</dependency>
```
Expand Down
15 changes: 15 additions & 0 deletions mds/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Release notes

## 2.3.4-RELEASE

#### Release date
November 6th, 2017.

#### Third-party versions
- RESTEasy: 3.1.4.Final
- Spring Boot: 1.5.8.RELEASE

#### New features and enhancements
1. [83 - Upgrade to Spring Boot version 1.5.8](https://github.com/paypal/resteasy-spring-boot/issues/83)

#### Bug fixes
None

## 2.3.3-RELEASE

#### Release date
Expand Down
2 changes: 1 addition & 1 deletion mds/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Add the Maven dependency below to your Spring Boot application pom file.<br>
<dependency>
<groupId>com.paypal.springboot</groupId>
<artifactId>resteasy-spring-boot-starter</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<scope>runtime</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.paypal.springboot</groupId>
<artifactId>resteasy-spring-boot-starter-parent</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<packaging>pom</packaging>

<modules>
Expand Down
47 changes: 47 additions & 0 deletions release_steps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
changes in develop branch
rev all 4 poms to release
update /README
set the new RELEASE version in Quick Start
update /mds/USAGE
set the new RELEASE version
update /mds/RELEASE_NOTES
check if it has all contributions (improvements and fixes)
set delivery date
set 3rd party versions
build everything to make sure it is Ok
check in changes to develop branch (Revving up to version 2.1.0-RELEASE)
merge all changes from develop branch to master (Bringing in 2.1.0 changes to master)

checkout master branch
git pull
build everything to make sure it is Ok
release from master
comment out cobertura plugin and cobertura reporting plugin in resteasy-spring-boot-starter/pom.xml (BUT NOT CHECK IT IN!)
deploy to MavenCentral(mvn clean install deploy -Possrh)
remove comment marks for cobertura plugin and cobertura reporting plugin
manual sonatype release
Staging Repositories
Close (the one with sources and everything)
Release
tag new release from master
git tag -a 2.1.0-RELEASE
git push origin 2.1.0-RELEASE

Close GitHub Milestone that has just been released

git checkout develop
rev develop branch to next snapshot version
rev all 4 poms in to next snapshot version
build everything to make sure it is Ok
update /README
set the new SNAPSHOT version in Quick Start
update /mds/USAGE
set the new SNAPSHOT version
update /mds/RELEASE NOTES
create new version section by copying latest one
set delivery date to TBD
set third-parties to TBD
set contributions (improvements and fixes) to TBD
check in changes to develop branch (Preparing for version 2.1.1-SNAPSHOT)

Create a new GitHub Milestone and assign issues to it (if any)
2 changes: 1 addition & 1 deletion resteasy-spring-boot-starter-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.paypal.springboot</groupId>
<artifactId>resteasy-spring-boot-starter-test</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<name>${project.artifactId}</name>

<description>Integration test project for RESTEasy Spring Boot starter</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ public void happyPathTest() {
response.then().statusCode(200).body("timestamp", notNullValue()).body("echoText", equalTo("is there anybody out there?"));
}

@Test
public void filterTest() {
Response response = given().body("is there anybody out there?").header("ping", "ping").post("/echo");
response.then().statusCode(200).body("timestamp", notNullValue()).body("echoText", equalTo("is there anybody out there?")).header("pong", equalTo("pong"));
}

@Test
public void invalidUriPathTest() {
// Notice "eco" is supposed to result in 404
Response response = given().body("is there anybody out there?").post("/eco");
response.then().statusCode(404).body(equalTo(""));
response.then().statusCode(404).body(equalTo("The resource you've requested, has not been found!"));
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions resteasy-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.paypal.springboot</groupId>
<artifactId>resteasy-spring-boot-starter</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<name>${project.artifactId}</name>

<description>A Spring Boot starter for RESTEasy</description>
Expand Down Expand Up @@ -44,7 +44,7 @@
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springboot.version>1.5.6.RELEASE</springboot.version>
<springboot.version>1.5.8.RELEASE</springboot.version>
<resteasy.version>3.1.4.Final</resteasy.version>
<coverage.line>80</coverage.line>
<coverage.branch>80</coverage.branch>
Expand Down
4 changes: 2 additions & 2 deletions sample-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

<groupId>com.test</groupId>
<artifactId>sample-app</artifactId>
<version>2.3.3-RELEASE</version>
<version>2.3.4-RELEASE</version>
<packaging>jar</packaging>

<description>Simple test application for the Resteasy Spring Boot starter</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<version>1.5.8.RELEASE</version>
<relativePath/>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sample-app/src/main/java/com/sample/app/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* SpringBoot entry point application
*
* Created by facarvalho on 12/7/15.
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.sample.app;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

/**
* Custom container request filter just to
* exercise Spring beans as providers and,
* specifically, in this case, as a filter.
*
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Component
@Provider
public class CustomContainerResponseFilter implements ContainerResponseFilter {

@Autowired
private CustomSingletonBean customSingletonBean;

@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {

// This will cause a NPE if this bean couldn't be injected,
// and that is all we want to check. No need for assertions here
customSingletonBean.amIAlive();

// Checks if request has a HTTP header named "ping".
// If it does, adds an HTTP header named "pong" to the response.
// The header value is irrelevant.
if(requestContext.getHeaderString("ping") != null) {
responseContext.getHeaders().add("pong", "pong");
}
}

}
36 changes: 36 additions & 0 deletions sample-app/src/main/java/com/sample/app/CustomExceptionMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.sample.app;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

/**
* Custom exception mapper for 404 cases.
*
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Component
@Provider
public class CustomExceptionMapper implements ExceptionMapper<NotFoundException> {

@Autowired
private CustomSingletonBean customSingletonBean;

@Override
public Response toResponse(NotFoundException exception) {

// This will cause a NPE if this bean couldn't be injected,
// and that is all we want to check. No need for assertions here
customSingletonBean.amIAlive();

Response.ResponseBuilder responseBuilder = Response.status(Response.Status.NOT_FOUND).entity("The resource you've requested, has not been found!");
responseBuilder.type(MediaType.TEXT_PLAIN);
return responseBuilder.build();
}

}
19 changes: 19 additions & 0 deletions sample-app/src/main/java/com/sample/app/CustomSingletonBean.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.sample.app;

import org.springframework.stereotype.Component;

/**
* This singleton Spring bean just exists to
* test that injections work normally in
* JAX-RS provider beans
*
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Component
public class CustomSingletonBean {

public boolean amIAlive() {
return true;
}

}
2 changes: 1 addition & 1 deletion sample-app/src/main/java/com/sample/app/Echo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Echo REST endpoint class
*
* Created by facarvalho on 12/7/15.
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Path("/echo")
@Component
Expand Down
2 changes: 1 addition & 1 deletion sample-app/src/main/java/com/sample/app/EchoMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple echo message, containing the text to be echoed
* and timestamp of the moment the message was created
*
* @author facarvalho
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
public class EchoMessage {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* This bean creates {@link EchoMessage} objects based on
* echo texts received as input
*
* @author facarvalho
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Component
public class EchoMessageCreator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* JAX-RS application
*
* Created by facarvalho on 12/7/15.
* @author Fabio Carvalho (facarvalho@paypal.com or fabiocarvalho777@gmail.com)
*/
@Component
@ApplicationPath("/sample-app/")
Expand Down

0 comments on commit 5df623d

Please sign in to comment.