Corrected test as per review comments

This commit is contained in:
Amitabh.Tiwari 2021-06-23 10:22:35 +05:30
parent 625676f7cb
commit b7f31513f8
1 changed files with 2 additions and 2 deletions

View File

@ -30,13 +30,13 @@ public class StringToBigIntegerUnitTest {
@Test(expected = NumberFormatException.class) @Test(expected = NumberFormatException.class)
public void whenGetStringWithRadix_thenThrowError() { public void whenGetStringWithRadix_thenThrowError() {
final String inputString = "Hello Baeldung"; final String inputString = "290f98";
new BigInteger(inputString, 7); new BigInteger(inputString, 7);
} }
@Test @Test
public void whenGetStringUsingByte_thenOk() { public void whenGetStringUsingByte_thenOk() {
final String inputString = "Hello Baeldung"; final String inputString = "290f98";
byte[] inputStringBytes = inputString.getBytes(); byte[] inputStringBytes = inputString.getBytes();
BigInteger result = new BigInteger(inputStringBytes); BigInteger result = new BigInteger(inputStringBytes);
assertEquals("Hello Baeldung", new String(result.toByteArray())); assertEquals("Hello Baeldung", new String(result.toByteArray()));