3030
3131import java .io .IOException ;
3232import java .io .InputStream ;
33+ import java .io .InputStreamReader ;
3334import java .io .PrintStream ;
35+ import java .nio .charset .StandardCharsets ;
3436
3537import static org .junit .jupiter .api .Assertions .assertThrows ;
3638import static org .mockito .Mockito .mock ;
3739import static org .mockito .Mockito .verify ;
3840import static uk .co .real_logic .sbe .xml .XmlSchemaParser .parse ;
3941
40- @ EnabledForJreRange (min = JRE .JAVA_8 , max = JRE .JAVA_17 )
42+ @ EnabledForJreRange (min = JRE .JAVA_8 , max = JRE .JAVA_18 )
4143public class Issue567GroupSizeTest
4244{
4345 public static final String ERR_MSG =
@@ -65,8 +67,7 @@ public void shouldThrowWhenUsingATypeThatIsNotConstrainedToFitInAnIntAsTheGroupS
6567 {
6668 final ParserOptions options = ParserOptions .builder ().stopOnError (true ).build ();
6769 final InputStream in = Tests .getLocalResource ("issue567-invalid.xml" );
68- final InputSource is = new InputSource (in );
69- is .setEncoding ("UTF-8" );
70+ final InputSource is = new InputSource (new InputStreamReader (in , StandardCharsets .UTF_8 ));
7071
7172 assertThrows (IllegalArgumentException .class , () -> parse (is , options ));
7273 }
@@ -76,8 +77,7 @@ public void shouldGenerateWhenUsingATypeThatIsConstrainedToFitInAnIntAsTheGroupS
7677 {
7778 final ParserOptions options = ParserOptions .builder ().stopOnError (true ).build ();
7879 final InputStream in = Tests .getLocalResource ("issue567-valid.xml" );
79- final InputSource is = new InputSource (in );
80- is .setEncoding ("UTF-8" );
80+ final InputSource is = new InputSource (new InputStreamReader (in , StandardCharsets .UTF_8 ));
8181
8282 final MessageSchema schema = parse (is , options );
8383 final IrGenerator irg = new IrGenerator ();
0 commit comments