Comment c = new Comment(1, "comment content", 1, postId, System.currentTimeMillis(), getDBS());
assertNotNull("Post should be findable by foreign key", c.getPost());
}
public void testCreateFromMap() throws IOException {
IUserPersistence users = dbs.getDatabase1().users();
long t0 = System.currentTimeMillis();
long t1 = t0 + 10;
long t2 = t0 + 20;
byte[] someBinary = new byte[]{5, 4, 3, 2, 1};
Map<Enum, Object> fieldsMap = new HashMap<Enum, Object>();
fieldsMap.put(User._Fields.handle, "bryand");
fieldsMap.put(User._Fields.created_at_millis, t0);
fieldsMap.put(User._Fields.num_posts, 5);
fieldsMap.put(User._Fields.some_date, t1);
fieldsMap.put(User._Fields.some_datetime, t2);
fieldsMap.put(User._Fields.bio, "this is a relatively long string");
fieldsMap.put(User._Fields.some_binary, someBinary);
fieldsMap.put(User._Fields.some_float, 1.2d);
fieldsMap.put(User._Fields.some_decimal, 3.4d);
fieldsMap.put(User._Fields.some_boolean, true);
User bryand = (User)users.create(fieldsMap);
verifyCreatedUser(users, t0, t1, t2, someBinary, bryand);
}