Пример #1
0
 @Test
 public void test() {
   deleteAndPopulateTable("people");
   Person p = Person.create("name", "Sam", "dob", "2001-01-07");
   a(p).shouldNotBe("valid");
   p.set("last_name", "Johnson");
   a(p).shouldBe("valid");
 }
Пример #2
0
  @Test
  public void shouldKeepParametersCase() {
    Person p = Person.create("name", "Joe", "last_name", "Schmoe");

    Map map = JsonHelper.toMap(p.toJson(true));
    a(map.get("name")).shouldBeEqual("Joe");
    a(map.get("last_name")).shouldBeEqual("Schmoe");

    map = JsonHelper.toMap(p.toJson(true, "Name", "Last_Name"));
    a(map.get("Name")).shouldBeEqual("Joe");
    a(map.get("Last_Name")).shouldBeEqual("Schmoe");
  }