use 2147483648 as string for unit tests
This commit is contained in:
parent
0efd1c3106
commit
975db60d35
|
@ -12,8 +12,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenString_whenUsingLongConstructor_thenObtainLongObject() {
|
public void givenString_whenUsingLongConstructor_thenObtainLongObject() {
|
||||||
Long l = new Long("1234567");
|
Long l = new Long("2147483648");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -23,8 +23,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenString_whenUsingLongValueOf_thenObtainLongObject() {
|
public void givenString_whenUsingLongValueOf_thenObtainLongObject() {
|
||||||
Long l = Long.valueOf("1234567");
|
Long l = Long.valueOf("2147483648");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -34,8 +34,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenString_whenUsingParseLong_thenObtainLongPrimitive() {
|
public void givenString_whenUsingParseLong_thenObtainLongPrimitive() {
|
||||||
long l = Long.parseLong("1234567");
|
long l = Long.parseLong("2147483648");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -45,8 +45,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenHexadecimalString_whenUsingLongDecode_thenObtainLongObject() {
|
public void givenHexadecimalString_whenUsingLongDecode_thenObtainLongObject() {
|
||||||
Long l = Long.decode("0x12d687");
|
Long l = Long.decode("0x80000000");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -56,8 +56,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenHexadecimalString_whenUsingApacheCommons_thenObtainLongObject() {
|
public void givenHexadecimalString_whenUsingApacheCommons_thenObtainLongObject() {
|
||||||
Long l = NumberUtils.createLong("0x12d687");
|
Long l = NumberUtils.createLong("0x80000000");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -67,8 +67,8 @@ public class StringToLongPrimitiveOrLongObjectUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenString_whenUsingGuava_thenObtainLongObject() {
|
public void givenString_whenUsingGuava_thenObtainLongObject() {
|
||||||
Long l = Longs.tryParse("1234567");
|
Long l = Longs.tryParse("2147483648");
|
||||||
assertThat(l).isEqualTo(1234567L);
|
assertThat(l).isEqualTo(2147483648L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue