mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Allow format() for types Integer and Long to handle string input
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ScalarTypeIntegerTest {
|
||||
|
||||
private final ScalarTypeInteger type = new ScalarTypeInteger();
|
||||
|
||||
@Test
|
||||
public void format_when_string() {
|
||||
assertThat(type.format("1")).isEqualTo("1");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void format_when_integer() {
|
||||
assertThat(type.format(1)).isEqualTo("1");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ScalarTypeLongTest {
|
||||
|
||||
private final ScalarTypeLong type = new ScalarTypeLong();
|
||||
|
||||
@Test
|
||||
public void format_when_string() {
|
||||
assertThat(type.format("1")).isEqualTo("1");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void format_when_long() {
|
||||
assertThat(type.format(1L)).isEqualTo("1");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user