1
1
/*
2
- * Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved .
2
+ * Copyright (c) 2019, 2022 Oracle and/or its affiliates.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
import org .junit .jupiter .api .Test ;
20
20
21
- import static org .junit .jupiter .api .Assertions .assertEquals ;
22
- import static org .junit .jupiter .api .Assertions .assertFalse ;
23
- import static org .junit .jupiter .api .Assertions .assertTrue ;
21
+ import static org .hamcrest .CoreMatchers .is ;
22
+ import static org .hamcrest .MatcherAssert .assertThat ;
24
23
25
24
/**
26
25
* Unit tests for class {@link Ascii}.
@@ -31,39 +30,39 @@ public class AsciiTest {
31
30
32
31
@ Test
33
32
public void testIsLowerCaseOne () {
34
- assertFalse (Ascii .isLowerCase ('{' ));
33
+ assertThat (Ascii .isLowerCase ('{' ), is ( false ));
35
34
}
36
35
37
36
38
37
@ Test
39
38
public void testIsLowerCaseReturningTrue () {
40
- assertTrue (Ascii .isLowerCase ('o' ));
39
+ assertThat (Ascii .isLowerCase ('o' ), is ( true ));
41
40
}
42
41
43
42
44
43
@ Test
45
44
public void testIsLowerCaseTwo () {
46
- assertFalse (Ascii .isLowerCase ('\"' ));
45
+ assertThat (Ascii .isLowerCase ('\"' ), is ( false ));
47
46
}
48
47
49
48
50
49
@ Test
51
50
public void testToLowerCaseTakingCharSequenceOne () {
52
51
StringBuilder stringBuilder = new StringBuilder ("uhho^s} b'jdwtym" );
53
52
54
- assertEquals ( "uhho^s} b'jdwtym" , Ascii . toLowerCase ( stringBuilder ));
53
+ assertThat ( Ascii . toLowerCase ( stringBuilder ), is ( "uhho^s} b'jdwtym" ));
55
54
}
56
55
57
56
58
57
@ Test
59
58
public void testToLowerCaseTakingCharSequenceTwo () {
60
- assertEquals ( "uhho^s} b'jdwtym" , Ascii .toLowerCase ((CharSequence ) "uHHO^S} b'jDwTYM" ));
59
+ assertThat ( Ascii .toLowerCase ((CharSequence ) "uHHO^S} b'jDwTYM" ), is ( "uhho^s} b'jdwtym " ));
61
60
}
62
61
63
62
64
63
@ Test
65
64
public void testToLowerCaseTakingString () {
66
- assertEquals ( "" , Ascii . toLowerCase ("" ));
65
+ assertThat ( Ascii . toLowerCase ( "" ), is ("" ));
67
66
}
68
67
69
68
}
0 commit comments