Skip to content

Commit 512a4c4

Browse files
authored
Use Hamcrest assertions instead of JUnit in common/http - backport helidon-2.x (#1749) (#4907)
1 parent 250742d commit 512a4c4

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

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

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2022 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.
@@ -18,9 +18,8 @@
1818

1919
import org.junit.jupiter.api.Test;
2020

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;
2423

2524
/**
2625
* Unit tests for class {@link Ascii}.
@@ -31,39 +30,39 @@ public class AsciiTest {
3130

3231
@Test
3332
public void testIsLowerCaseOne() {
34-
assertFalse(Ascii.isLowerCase('{'));
33+
assertThat(Ascii.isLowerCase('{'), is(false));
3534
}
3635

3736

3837
@Test
3938
public void testIsLowerCaseReturningTrue() {
40-
assertTrue(Ascii.isLowerCase('o'));
39+
assertThat(Ascii.isLowerCase('o'), is(true));
4140
}
4241

4342

4443
@Test
4544
public void testIsLowerCaseTwo() {
46-
assertFalse(Ascii.isLowerCase('\"'));
45+
assertThat(Ascii.isLowerCase('\"'), is(false));
4746
}
4847

4948

5049
@Test
5150
public void testToLowerCaseTakingCharSequenceOne() {
5251
StringBuilder stringBuilder = new StringBuilder("uhho^s} b'jdwtym");
5352

54-
assertEquals("uhho^s} b'jdwtym", Ascii.toLowerCase(stringBuilder));
53+
assertThat(Ascii.toLowerCase(stringBuilder), is("uhho^s} b'jdwtym"));
5554
}
5655

5756

5857
@Test
5958
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"));
6160
}
6261

6362

6463
@Test
6564
public void testToLowerCaseTakingString() {
66-
assertEquals("", Ascii.toLowerCase(""));
65+
assertThat(Ascii.toLowerCase(""), is(""));
6766
}
6867

6968
}

0 commit comments

Comments
 (0)