-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLowerCaserTest.java
More file actions
38 lines (28 loc) · 927 Bytes
/
LowerCaserTest.java
File metadata and controls
38 lines (28 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.example.testing.pitest;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;
/**
* More pitest demo tests showing the drawbacks - trying to catch some mutants
* is hard work.
*/
class LowerCaserTest {
private final LowerCaser lowerCaser = new LowerCaser();
@Test
void test() {
var expected = List.of("a", "b", "c");
var actual = lowerCaser.lowerCase(List.of("A", "B", "C"));
assertThat(actual).isEqualTo(expected);
}
@Test
@Disabled
void convoluted_test() {
List<String> mockList = spy(List.of());
var actual = lowerCaser.lowerCase(mockList);
assertThat(actual).isEmpty();
verify(mockList, never()).iterator();
}
}