Skip to content

Commit 71dec8d

Browse files
Apply Palantir Java Format
1 parent 866eef6 commit 71dec8d

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

rqueue-core/src/test/java/com/github/sonus21/rqueue/listener/RqueueMessageListenerContainerTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
import com.github.sonus21.rqueue.core.RqueueBeanProvider;
3838
import com.github.sonus21.rqueue.core.RqueueMessage;
3939
import com.github.sonus21.rqueue.core.RqueueMessageTemplate;
40-
import com.github.sonus21.rqueue.models.Concurrency;
4140
import com.github.sonus21.rqueue.dao.RqueueSystemConfigDao;
41+
import com.github.sonus21.rqueue.models.Concurrency;
4242
import com.github.sonus21.rqueue.models.db.MessageMetadata;
4343
import com.github.sonus21.rqueue.models.db.QueueConfig;
4444
import com.github.sonus21.rqueue.models.enums.MessageStatus;
@@ -178,7 +178,8 @@ void setTaskExecutor() {
178178
@Test
179179
void globalMaxRetryCapsDefaultRetryForever() throws Exception {
180180
beanProvider.getRqueueConfig().setMaxRetry(5);
181-
doReturn(handlerMap(mapping(slowQueue, -1, null))).when(rqueueMessageHandler)
181+
doReturn(handlerMap(mapping(slowQueue, -1, null)))
182+
.when(rqueueMessageHandler)
182183
.getHandlerMethodMap();
183184

184185
container.afterPropertiesSet();
@@ -189,7 +190,8 @@ void globalMaxRetryCapsDefaultRetryForever() throws Exception {
189190
@Test
190191
void globalMaxRetryDoesNotOverrideExplicitRetryCount() throws Exception {
191192
beanProvider.getRqueueConfig().setMaxRetry(2);
192-
doReturn(handlerMap(mapping(slowQueue, 10, null))).when(rqueueMessageHandler)
193+
doReturn(handlerMap(mapping(slowQueue, 10, null)))
194+
.when(rqueueMessageHandler)
193195
.getHandlerMethodMap();
194196

195197
container.afterPropertiesSet();
@@ -200,7 +202,8 @@ void globalMaxRetryDoesNotOverrideExplicitRetryCount() throws Exception {
200202
@Test
201203
void globalMaxRetryDoesNotRaiseLowerExplicitRetryCount() throws Exception {
202204
beanProvider.getRqueueConfig().setMaxRetry(5);
203-
doReturn(handlerMap(mapping(slowQueue, 2, null))).when(rqueueMessageHandler)
205+
doReturn(handlerMap(mapping(slowQueue, 2, null)))
206+
.when(rqueueMessageHandler)
204207
.getHandlerMethodMap();
205208

206209
container.afterPropertiesSet();
@@ -211,7 +214,8 @@ void globalMaxRetryDoesNotRaiseLowerExplicitRetryCount() throws Exception {
211214
@Test
212215
void globalMaxRetryCanDisableRetries() throws Exception {
213216
beanProvider.getRqueueConfig().setMaxRetry(0);
214-
doReturn(handlerMap(mapping(slowQueue, -1, null))).when(rqueueMessageHandler)
217+
doReturn(handlerMap(mapping(slowQueue, -1, null)))
218+
.when(rqueueMessageHandler)
215219
.getHandlerMethodMap();
216220

217221
container.afterPropertiesSet();
@@ -222,12 +226,14 @@ void globalMaxRetryCanDisableRetries() throws Exception {
222226
@Test
223227
void globalMaxRetryDoesNotOverrideDeadLetterDefaultRetryCount() throws Exception {
224228
beanProvider.getRqueueConfig().setMaxRetry(0);
225-
doReturn(handlerMap(mapping(slowQueue, -1, slowQueue + "-dlq"))).when(rqueueMessageHandler)
229+
doReturn(handlerMap(mapping(slowQueue, -1, slowQueue + "-dlq")))
230+
.when(rqueueMessageHandler)
226231
.getHandlerMethodMap();
227232

228233
container.afterPropertiesSet();
229234

230-
assertEquals(Constants.DEFAULT_RETRY_DEAD_LETTER_QUEUE,
235+
assertEquals(
236+
Constants.DEFAULT_RETRY_DEAD_LETTER_QUEUE,
231237
EndpointRegistry.get(slowQueue).getNumRetry());
232238
}
233239

rqueue-spring-boot-starter/src/test/java/com/github/sonus21/rqueue/spring/boot/integration/NatsGlobalRetryLimitE2EIT.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ void globalRetryLimitCapsImplicitRetryForever() throws Exception {
7171
enqueuer.enqueue(QUEUE, "payload");
7272

7373
assertThat(listener.twoAttempts.await(20, TimeUnit.SECONDS)).isTrue();
74-
Awaitility.await().during(Duration.ofSeconds(2)).atMost(Duration.ofSeconds(3)).untilAsserted(
75-
() -> assertThat(listener.attempts).hasValue(2));
74+
Awaitility.await()
75+
.during(Duration.ofSeconds(2))
76+
.atMost(Duration.ofSeconds(3))
77+
.untilAsserted(() -> assertThat(listener.attempts).hasValue(2));
7678

77-
assertThat(jsm
78-
.getConsumerInfo(STREAM_PREFIX + QUEUE, QUEUE + "-consumer")
79+
assertThat(jsm.getConsumerInfo(STREAM_PREFIX + QUEUE, QUEUE + "-consumer")
7980
.getConsumerConfiguration()
8081
.getMaxDeliver())
8182
.isEqualTo(3L);

rqueue-spring-boot-starter/src/test/java/com/github/sonus21/rqueue/spring/boot/tests/integration/RedisGlobalRetryLimitE2EIT.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ void globalRetryLimitCapsImplicitRetryForever() throws Exception {
5858
enqueuer.enqueue(QUEUE, "payload");
5959

6060
assertThat(listener.twoAttempts.await(20, TimeUnit.SECONDS)).isTrue();
61-
Awaitility.await().during(Duration.ofSeconds(2)).atMost(Duration.ofSeconds(3)).untilAsserted(
62-
() -> assertThat(listener.attempts).hasValue(2));
61+
Awaitility.await()
62+
.during(Duration.ofSeconds(2))
63+
.atMost(Duration.ofSeconds(3))
64+
.untilAsserted(() -> assertThat(listener.attempts).hasValue(2));
6365
}
6466

6567
@SpringBootApplication

0 commit comments

Comments
 (0)