File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
sbe-tool/src/test/java/uk/co/real_logic/sbe/generation Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 2323import uk .co .real_logic .sbe .xml .MessageSchema ;
2424import uk .co .real_logic .sbe .xml .ParserOptions ;
2525
26- import static org .junit .jupiter .api .Assertions .assertFalse ;
27- import static org .junit .jupiter .api .Assertions .assertTrue ;
26+ import static org .hamcrest .MatcherAssert .assertThat ;
27+ import static org .hamcrest .Matchers .containsString ;
28+ import static org .hamcrest .Matchers .not ;
2829import static uk .co .real_logic .sbe .xml .XmlSchemaParser .parse ;
2930
3031public class CppGeneratorTest
@@ -43,7 +44,7 @@ public void shouldUseGeneratedLiteralForConstantOneWhenGeneratingBitsetCode() th
4344 generator .generate ();
4445
4546 final String source = outputManager .getSource ("issue827.FlagsSet" ).toString ();
46- assertFalse (source . contains ( "1u << " ));
47- assertTrue (source . contains ("UINT64_C(0x1) << " ));
47+ assertThat (source , not ( containsString ( "1u << " ) ));
48+ assertThat (source , containsString ("UINT64_C(0x1) << " ));
4849 }
4950}
Original file line number Diff line number Diff line change 3131import java .io .PrintStream ;
3232import java .nio .charset .StandardCharsets ;
3333
34+ import static org .hamcrest .MatcherAssert .assertThat ;
35+ import static org .hamcrest .Matchers .containsString ;
3436import static org .junit .jupiter .api .Assertions .assertThrows ;
35- import static org .junit .jupiter .api .Assertions .assertTrue ;
3637import static org .mockito .Mockito .mock ;
3738import static org .mockito .Mockito .verify ;
3839
@@ -86,6 +87,6 @@ public void shouldGenerateWhenUsingATypeThatIsConstrainedToFitInAnIntAsTheGroupS
8687 generator .generate ();
8788
8889 final String source = outputManager .getSource ("tests.Issue567" ).toString ();
89- assertTrue (source . contains (EXPECTED_COUNT_CHECK ));
90+ assertThat (source , containsString (EXPECTED_COUNT_CHECK ));
9091 }
9192}
Original file line number Diff line number Diff line change @@ -39,22 +39,19 @@ public class RustUtilTest
3939 @ Test
4040 public void nullParamToEightBitCharacterThrowsNPE ()
4141 {
42- assertThrows (NullPointerException .class , () ->
43- RustUtil .eightBitCharacter (null ));
42+ assertThrows (NullPointerException .class , () -> RustUtil .eightBitCharacter (null ));
4443 }
4544
4645 @ Test
4746 public void emptyParamToEightBitCharacterThrowsIAE ()
4847 {
49- assertThrows (IllegalArgumentException .class , () ->
50- RustUtil .eightBitCharacter ("" ));
48+ assertThrows (IllegalArgumentException .class , () -> RustUtil .eightBitCharacter ("" ));
5149 }
5250
5351 @ Test
5452 public void tooManyCharactersParamToEightBitCharacterThrowsIAE ()
5553 {
56- assertThrows (IllegalArgumentException .class , () ->
57- RustUtil .eightBitCharacter ("ABC" ));
54+ assertThrows (IllegalArgumentException .class , () -> RustUtil .eightBitCharacter ("ABC" ));
5855 }
5956
6057 @ Test
You can’t perform that action at this time.
0 commit comments