// -------------------------------------+ @Test public void findRepostByUsers_Entity_単数_00() { User usr1 = User.findBySerialCode("usr-goro").first(); List<RepostBase> lst = RepostBase.findRepostByUsers(usr1).fetch(); assertThat(lst.size(), is(4)); // DBからの取得リストの並び保証なし }
@Test public void findRepostByUsers_String_単数_投稿者_00() { Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByUsers("usr-goro").contributor(acnt).fetch(); assertThat(lst.size(), is(2)); // DBからの取得リストの並び保証なし }
@Test public void findRepostByUsers_Entity_複数_投稿者_00() { User usr1 = User.findBySerialCode("usr-goro").first(); User usr2 = User.findBySerialCode("usr-jiro").first(); Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByUsers(usr1, usr2).contributor(acnt).fetch(); assertThat(lst.size(), is(5)); // DBからの取得リストの並び保証なし }
@Test public void findRepostByUsers_String_複数_投稿者_降順_00() { Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByUsers("usr-goro", "usr-jiro") .contributor(acnt) .orderBy(RepostBase.OrderBy.DATE_OF_REPOST_DESC) .fetch(); assertThat(lst.size(), is(5)); assertThat(lst.get(0).getItem().serialCode, is("usr-jiro")); }
@Test public void findRepostByUsers_String_単数_00() { List<RepostBase> lst = RepostBase.findRepostByUsers("usr-goro").fetch(); assertThat(lst.size(), is(4)); // DBからの取得リストの並び保証なし }
// =============================================* // 問題なし @Test public void findRepostByUsers_例外_00() { List<RepostBase> lst = RepostBase.findRepostByUsers((Object) null).fetch(); assertThat(lst.size(), is(10)); }