Skip to content

Commit 4b913cc

Browse files
committed
4.x: Use Hamcrest assertions instead of JUnit in common/buffers (helidon-io#1749)
1 parent 335c98b commit 4b913cc

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

common/buffers/src/test/java/io/helidon/common/buffers/AsciiTest.java

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,24 +19,21 @@
1919

2020
import static org.hamcrest.CoreMatchers.is;
2121
import static org.hamcrest.MatcherAssert.assertThat;
22-
import static org.junit.jupiter.api.Assertions.assertEquals;
23-
import static org.junit.jupiter.api.Assertions.assertFalse;
24-
import static org.junit.jupiter.api.Assertions.assertTrue;
2522

2623
class AsciiTest {
2724
@Test
2825
void testIsLowerCaseOne() {
29-
assertFalse(Ascii.isLowerCase('{'));
26+
assertThat(Ascii.isLowerCase('{'), is(false));
3027
}
3128

3229
@Test
3330
void testIsLowerCaseReturningTrue() {
34-
assertTrue(Ascii.isLowerCase('o'));
31+
assertThat(Ascii.isLowerCase('o'), is(true));
3532
}
3633

3734
@Test
3835
void testIsLowerCaseTwo() {
39-
assertFalse(Ascii.isLowerCase('\"'));
36+
assertThat(Ascii.isLowerCase('\"'), is(false));
4037
}
4138

4239
@Test
@@ -52,32 +49,32 @@ void testToLowerCaseChar() {
5249
void testToLowerCaseTakingCharSequenceOne() {
5350
StringBuilder stringBuilder = new StringBuilder("uhho^s} b'jdwtym");
5451

55-
assertEquals("uhho^s} b'jdwtym", Ascii.toLowerCase(stringBuilder));
52+
assertThat(Ascii.toLowerCase(stringBuilder), is("uhho^s} b'jdwtym"));
5653
}
5754

5855
@Test
5956
void testToLowerCaseTakingCharSequenceTwo() {
60-
assertEquals("uhho^s} b'jdwtym", Ascii.toLowerCase((CharSequence) "uHHO^S} b'jDwTYM"));
57+
assertThat(Ascii.toLowerCase((CharSequence) "uHHO^S} b'jDwTYM"), is("uhho^s} b'jdwtym"));
6158
}
6259

6360
@Test
6461
void testToLowerCaseTakingString() {
65-
assertEquals("", Ascii.toLowerCase(""));
62+
assertThat(Ascii.toLowerCase(""), is(""));
6663
}
6764

6865
@Test
6966
void testIsUpperCaseOne() {
70-
assertFalse(Ascii.isUpperCase('{'));
67+
assertThat(Ascii.isUpperCase('{'), is(false));
7168
}
7269

7370
@Test
7471
void testIsUpperCaseReturningTrue() {
75-
assertTrue(Ascii.isUpperCase('O'));
72+
assertThat(Ascii.isUpperCase('O'), is(true));
7673
}
7774

7875
@Test
7976
void testIsUpperCaseTwo() {
80-
assertFalse(Ascii.isUpperCase('\"'));
77+
assertThat(Ascii.isUpperCase('\"'), is(false));
8178
}
8279

8380
@Test
@@ -93,16 +90,16 @@ void testToUpperCaseChar() {
9390
void testToUpperCaseTakingCharSequenceOne() {
9491
StringBuilder stringBuilder = new StringBuilder("UhHO^S} B'JDWTYM");
9592

96-
assertEquals("UHHO^S} B'JDWTYM", Ascii.toUpperCase(stringBuilder));
93+
assertThat(Ascii.toUpperCase(stringBuilder), is("UHHO^S} B'JDWTYM"));
9794
}
9895

9996
@Test
10097
void testToUpperCaseTakingCharSequenceTwo() {
101-
assertEquals("UHHO^S} B'JDWTYM", Ascii.toUpperCase((CharSequence) "uHHO^S} b'jDwTYM"));
98+
assertThat(Ascii.toUpperCase((CharSequence) "uHHO^S} b'jDwTYM"), is("UHHO^S} B'JDWTYM"));
10299
}
103100

104101
@Test
105102
void testToUpperCaseTakingString() {
106-
assertEquals("UHHO^S} B'JDWTYM", Ascii.toUpperCase("uHHO^S} b'jDwTYM"));
103+
assertThat(Ascii.toUpperCase("uHHO^S} b'jDwTYM"), is("UHHO^S} B'JDWTYM"));
107104
}
108105
}

0 commit comments

Comments
 (0)