-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from seanliu-oss/make-WAIT_TIME_SECONDS-modif…
…iable Make wait time seconds modifiable
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/java/com/amazon/sqs/javamessaging/ModifyWaitTimeSecondsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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.*; | ||
|
||
class ModifyWaitTimeSecondsTest { | ||
@DisplayName("Should be able to modify SQSMessageConsumerPrefetch.WAIT_TIME_SECONDS via Reflection") | ||
@Test | ||
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); | ||
} | ||
} |