@Test public void findRepostByCategories_String_単数_投稿者_00() { Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByCategories("cat-biz").contributor(acnt).fetch(); assertThat(lst.size(), is(2)); // DBからの取得リストの並び保証なし }
// -------------------------------------+ @Test public void findRepostByCategories_Entity_単数_00() { Category cat1 = Category.findBySerialCode("cat-biz").first(); List<RepostBase> lst = RepostBase.findRepostByCategories(cat1).fetch(); assertThat(lst.size(), is(2)); // DBからの取得リストの並び保証なし }
@Test public void findRepostByCategories_Entity_複数_投稿者_00() { Category cat1 = Category.findBySerialCode("cat-biz").first(); Category cat2 = Category.findBySerialCode("cat-enta").first(); Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByCategories(cat1, cat2).contributor(acnt).fetch(); assertThat(lst.size(), is(3)); // DBからの取得リストの並び保証なし }
@Test public void findRepostByCategories_String_複数_投稿者_降順_00() { Account acnt = Account.findByLoginName("goro_san").first(); List<RepostBase> lst = RepostBase.findRepostByCategories("cat-biz", "cat-enta") .contributor(acnt) .orderBy(RepostBase.OrderBy.DATE_OF_REPOST_DESC) .fetch(); assertThat(lst.size(), is(3)); assertThat(lst.get(0).getLabel().serialCode, is("cat-biz")); }
@Test public void findRepostByCategories_String_複数_00() { List<RepostBase> lst = RepostBase.findRepostByCategories("cat-biz", "cat-enta").fetch(); assertThat(lst.size(), is(5)); // DBからの取得リストの並び保証なし }
// =============================================* // 問題なし @Test public void findRepostByCategories_例外_00() { List<RepostBase> lst = RepostBase.findRepostByCategories((Object) null).fetch(); assertThat(lst.size(), is(10)); }