Skip to content

Commit

Permalink
Up SDK version to date & make WAIT_TIME_SECONDS modifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyanli-amazon committed Dec 8, 2022
1 parent 7343e7d commit ad8b9f2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for communicating with Amazon Simple Queue Service. This project builds on top o
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-sqs-java-messaging-lib</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<type>jar</type>
</dependency>
```
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-sqs-java-messaging-lib</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<name>Amazon SQS Java Messaging Library</name>
<description>The Amazon SQS Java Messaging Library holds the Java Message Service compatible classes, that are used
for communicating with Amazon Simple Queue Service.
Expand All @@ -29,7 +29,7 @@
</developer>
</developers>
<properties>
<aws-java-sdk.version>1.11.106</aws-java-sdk.version>
<aws-java-sdk.version>1.12.360</aws-java-sdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -47,7 +47,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.0-M1</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.10.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class SQSMessageConsumerPrefetch implements Runnable, PrefetchManager {

private static final Log LOG = LogFactory.getLog(SQSMessageConsumerPrefetch.class);

protected static final int WAIT_TIME_SECONDS = 20;
protected static int WAIT_TIME_SECONDS = 20;

protected static final String ALL = "All";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazon.sqs.javamessaging;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.lang.reflect.Field;

import static org.junit.jupiter.api.Assertions.assertEquals;

class ModifyWaitTimeSecondsTest {

@DisplayName("Should be able to modify SQSMessageConsumerPrefetch.WAIT_TIME_SECONDS via Reflection")
@Test
public void waitTimeSecondsShouldBeModifiableViaReflection() throws NoSuchFieldException, IllegalAccessException {
Field wait_time_seconds = SQSMessageConsumerPrefetch.class.getDeclaredField("WAIT_TIME_SECONDS");
wait_time_seconds.setAccessible(true);
wait_time_seconds.setInt(null,5);
assertEquals(5, SQSMessageConsumerPrefetch.WAIT_TIME_SECONDS);
}
}

0 comments on commit ad8b9f2

Please sign in to comment.