272829303132333435363738
return check; } String name = jsonText("name"); Sample m = new Sample(); m.setName(name); Long key = dao.create(m); if (log.isDebugEnabled()) log.debug("key : " + key);
107108109110111112113114115116117118
assertThat(res.getKey()).isEqualTo(42L); } @Test public void testCreate() { Sample entity = new Sample(); entity.setName("test"); setHttpContext(toJson(entity)); Result result = controller.create(); assertThat(result).isNotNull();