File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
core/src/test/java/org/owasp/encoder Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ public void testXML11C0ControlChars() {
206206 char ch = (char ) i ;
207207 String input = "a" + ch + "b" ;
208208 String result = Encode .forXml11 (input );
209- String expected = "a&#x" + Integer . toHexString ( i ) + ";b" ;
209+ String expected = "a&#x" + String . format ( "%02x" , i ) + ";b" ;
210210 assertEquals ("C0 control char 0x" + Integer .toHexString (i ) + " should be encoded" ,
211211 expected , result );
212212 }
@@ -225,8 +225,8 @@ public void testXML11C1ControlChars() {
225225 char ch = (char ) i ;
226226 String input = "a" + ch + "b" ;
227227 String result = Encode .forXml11 (input );
228- String expected = "a&#x" + Integer . toHexString ( i ) + ";b" ;
229- assertEquals ("C1 control char 0x" + Integer . toHexString ( i ) + " should be encoded" ,
228+ String expected = "a&#x" + String . format ( "%02x" , i ) + ";b" ;
229+ assertEquals ("C1 control char 0x" + String . format ( "%02x" , i ) + " should be encoded" ,
230230 expected , result );
231231 }
232232 }
You can’t perform that action at this time.
0 commit comments