Skip to content

Commit 3b0fef0

Browse files
Karthikeyan SubbarajCalamarBicefalo
authored andcommitted
Unit tests method names and class names modified as per the guidelines
1 parent 9bc5b95 commit 3b0fef0

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

core-java-collections/src/test/java/com/baeldung/stack_tests/MultithreadingCorrectnessStackTests.java renamed to core-java-collections/src/test/java/com/baeldung/stack_tests/MultithreadingCorrectnessStackUnitTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
/**
1313
* Correctness tests for Stack in multi threaded environment.
1414
*/
15-
public class MultithreadingCorrectnessStackTests {
15+
public class MultithreadingCorrectnessStackUnitTest {
1616

1717
@Test
18-
public void test_multithreading_correctness_with_synchronized_deque() {
18+
public void givenSynchronizedDeque_whenExecutedParallel_thenWorkRight() {
1919

2020
DequeBasedSynchronizedStack<Integer> deque = new DequeBasedSynchronizedStack<>();
2121

@@ -41,7 +41,7 @@ public void test_multithreading_correctness_with_synchronized_deque() {
4141
}
4242

4343
@Test
44-
public void test_multithreading_correctness_with_concurrent_linked_queue() {
44+
public void givenConcurrentLinkedQueue_whenExecutedParallel_thenWorkRight() {
4545

4646
ConcurrentLinkedDeque<Integer> deque = new ConcurrentLinkedDeque<>();
4747

@@ -67,7 +67,7 @@ public void test_multithreading_correctness_with_concurrent_linked_queue() {
6767
}
6868

6969
@Test
70-
public void test_multithreading_correctness_with_array_deque() {
70+
public void givenArrayDeque_whenExecutedParallel_thenShouldFail() {
7171

7272
ArrayDeque<Integer> deque = new ArrayDeque<>();
7373

core-java-collections/src/test/java/com/baeldung/stack_tests/StackTests.java renamed to core-java-collections/src/test/java/com/baeldung/stack_tests/StackUnitTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
/**
1818
* These tests are to understand the Stack implementation in Java Collections.
1919
*/
20-
public class StackTests {
20+
public class StackUnitTest {
2121

2222
@Test
23-
public void test_basic_with_stack() {
23+
public void givenStack_whenPushPopPeek_thenWorkRight() {
2424
Stack<String> namesStack = new Stack<>();
2525

2626
namesStack.push("Bill Gates");
@@ -34,7 +34,7 @@ public void test_basic_with_stack() {
3434
}
3535

3636
@Test
37-
public void test_basic_with_synchronized_deque() {
37+
public void givenSynchronizedDeque_whenPushPopPeek_thenWorkRight() {
3838
DequeBasedSynchronizedStack<String> namesStack = new DequeBasedSynchronizedStack<>();
3939

4040
namesStack.push("Bill Gates");
@@ -48,7 +48,7 @@ public void test_basic_with_synchronized_deque() {
4848
}
4949

5050
@Test
51-
public void test_basic_with_concurrent_linked_queue() {
51+
public void givenConcurrentLinkedDeque_whenPushPopPeek_thenWorkRight() {
5252
ConcurrentLinkedDeque<String> namesStack = new ConcurrentLinkedDeque<>();
5353

5454
namesStack.push("Bill Gates");

0 commit comments

Comments
 (0)