Skip to content

Commit b0df093

Browse files
authored
BAEL-845 TransferQueueTest.java (eugenp#1719)
1 parent 4d17d26 commit b0df093

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎core-java/src/test/java/com/baeldung/transferqueue/TransferQueueTest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class TransferQueueTest {
1313

1414
@Test
15-
public void givenTransferQueue_whenUseMultipleConsumersAndMultipleProducers_thenShouldProcessAllMessages() throws InterruptedException {
15+
public void whenMultipleConsumersAndProducers_thenProcessAllMessages() throws InterruptedException {
1616
//given
1717
TransferQueue<String> transferQueue = new LinkedTransferQueue<>();
1818
ExecutorService exService = Executors.newFixedThreadPool(3);
@@ -28,15 +28,15 @@ public void givenTransferQueue_whenUseMultipleConsumersAndMultipleProducers_then
2828
exService.execute(consumer2);
2929

3030
//then
31-
exService.awaitTermination(10_000, TimeUnit.MILLISECONDS);
31+
exService.awaitTermination(5000, TimeUnit.MILLISECONDS);
3232
exService.shutdown();
3333

3434
assertEquals(producer1.numberOfProducedMessages.intValue(), 3);
3535
assertEquals(producer2.numberOfProducedMessages.intValue(), 3);
3636
}
3737

3838
@Test
39-
public void givenTransferQueue_whenUseOneConsumerAndOneProducer_thenShouldProcessAllMessages() throws InterruptedException {
39+
public void whenUseOneConsumerAndOneProducer_thenShouldProcessAllMessages() throws InterruptedException {
4040
//given
4141
TransferQueue<String> transferQueue = new LinkedTransferQueue<>();
4242
ExecutorService exService = Executors.newFixedThreadPool(2);
@@ -56,7 +56,7 @@ public void givenTransferQueue_whenUseOneConsumerAndOneProducer_thenShouldProces
5656
}
5757

5858
@Test
59-
public void givenTransferQueue_whenUseOneProducerAndNoConsumers_thenShouldFailWithTimeout() throws InterruptedException {
59+
public void whenUseOneProducerAndNoConsumers_thenShouldFailWithTimeout() throws InterruptedException {
6060
//given
6161
TransferQueue<String> transferQueue = new LinkedTransferQueue<>();
6262
ExecutorService exService = Executors.newFixedThreadPool(2);

0 commit comments

Comments
 (0)