1212public 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