Skip to content

Commit 350544e

Browse files
authored
Merge pull request #41 from wreulicke/feature/fix-deprecations
Fix deprecations
2 parents 70bf102 + fd20534 commit 350544e

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

spar-wings-awscli-config/src/main/java/jp/xet/sparwings/aws/auth/AwsCliProfile.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@
1919
import lombok.Getter;
2020
import lombok.RequiredArgsConstructor;
2121

22-
import org.apache.http.annotation.Immutable;
23-
2422
import com.amazonaws.auth.AWSCredentialsProvider;
2523

2624
/**
2725
* TODO for daisuke
28-
*
26+
*
2927
* @since 0.10
3028
* @version $Id$
3129
* @author daisuke
3230
*/
33-
@Immutable
3431
@RequiredArgsConstructor
3532
@EqualsAndHashCode
3633
public class AwsCliProfile {

spar-wings-dynamodb-json-patch/src/test/java/jp/xet/sparwings/dynamodb/patch/JsonPatchToExpressionSpecBuilderRemoveIT.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
import org.slf4j.Logger;
2424
import org.slf4j.LoggerFactory;
2525

26+
import org.junit.AssumptionViolatedException;
2627
import org.junit.Before;
2728
import org.junit.Test;
28-
import org.junit.internal.AssumptionViolatedException;
2929

3030
import com.amazonaws.AmazonClientException;
3131
import com.amazonaws.AmazonServiceException;
32-
import com.amazonaws.regions.Region;
3332
import com.amazonaws.regions.Regions;
3433
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
3534
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
@@ -65,10 +64,10 @@ public class JsonPatchToExpressionSpecBuilderRemoveIT {
6564

6665

6766
@Before
68-
public void setUp() throws Exception {
67+
public void setUp() {
6968
try {
70-
AmazonDynamoDB amazonDynamoDB = new AmazonDynamoDBClient();
71-
amazonDynamoDB.setRegion(Region.getRegion(Regions.AP_NORTHEAST_1));
69+
AmazonDynamoDB amazonDynamoDB = AmazonDynamoDBClient.builder()
70+
.withRegion(Regions.AP_NORTHEAST_1).build();
7271
table = new Table(amazonDynamoDB, "json_patch_test");
7372
table.deleteItem(PK);
7473
} catch (AmazonClientException e) {

spar-wings-dynamodb-json-patch/src/test/java/jp/xet/sparwings/dynamodb/patch/JsonPatchToExpressionSpecBuilderReplaceIT.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
2626

27+
import org.junit.AssumptionViolatedException;
2728
import org.junit.Before;
2829
import org.junit.Test;
29-
import org.junit.internal.AssumptionViolatedException;
3030

3131
import com.amazonaws.AmazonClientException;
3232
import com.amazonaws.AmazonServiceException;
33-
import com.amazonaws.regions.Region;
3433
import com.amazonaws.regions.Regions;
3534
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
3635
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
@@ -68,10 +67,10 @@ public class JsonPatchToExpressionSpecBuilderReplaceIT {
6867

6968

7069
@Before
71-
public void setUp() throws Exception {
70+
public void setUp() {
7271
try {
73-
AmazonDynamoDB amazonDynamoDB = new AmazonDynamoDBClient();
74-
amazonDynamoDB.setRegion(Region.getRegion(Regions.AP_NORTHEAST_1));
72+
AmazonDynamoDB amazonDynamoDB = AmazonDynamoDBClient.builder()
73+
.withRegion(Regions.AP_NORTHEAST_1).build();
7574
table = new Table(amazonDynamoDB, "json_patch_test");
7675
table.deleteItem(PK);
7776
} catch (AmazonClientException e) {

spar-wings-monolith/src/main/java/jp/xet/sparwings/spring/web/error/handler/DefaultRestErrorResolver.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.springframework.web.bind.MissingServletRequestParameterException;
3838
import org.springframework.web.context.request.ServletWebRequest;
3939
import org.springframework.web.servlet.LocaleResolver;
40-
import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException;
4140

4241
/**
4342
* Default {@code RestErrorResolver} implementation that converts discovered Exceptions to
@@ -104,7 +103,6 @@ protected final Map<String, String> createDefaultExceptionMappingDefinitions() {
104103
applyDef(m, "javax.validation.ValidationException", HttpStatus.BAD_REQUEST);
105104

106105
// 404
107-
applyDef(m, NoSuchRequestHandlingMethodException.class, HttpStatus.NOT_FOUND);
108106
applyDef(m, "org.hibernate.ObjectNotFoundException", HttpStatus.NOT_FOUND);
109107

110108
// 405
@@ -230,9 +228,9 @@ protected String getMessage(String msg, ServletWebRequest webRequest, Exception
230228
/**
231229
* Returns the config-time 'template' RestError instance configured for the specified Exception, or
232230
* {@code null} if a match was not found.
233-
*
231+
*
234232
* <p>The config-time template is used as the basis for the RestError constructed at runtime.</p>
235-
*
233+
*
236234
* @param ex
237235
* @return the template to use for the RestError instance to be constructed.
238236
*/
@@ -263,10 +261,10 @@ private RestError getRestErrorTemplate(Exception ex) {
263261

264262
/**
265263
* Return the depth to the superclass matching.
266-
*
264+
*
267265
* <p>0 means ex matches exactly. Returns -1 if there's no match.
268266
* Otherwise, returns depth. Lowest depth wins.</p>
269-
*
267+
*
270268
* @param exceptionMapping
271269
* @param ex
272270
* @return

0 commit comments

Comments
 (0)