test(posts): null cursor 회귀 테스트 추가 (168671b)
listPublishedKeyset 에 cursor=null·categoryId=null 전달 시 posts-list 뷰 정상 반환 검증. isNull() matcher 로 null 파라미터가 매퍼에 실제 전달됨을 명시. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3FeMrbtxfTScjrwUukyHD
This commit is contained in:
parent
db816e10fc
commit
327fe1df25
|
|
@ -29,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isNull;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
|
@ -232,6 +233,21 @@ class PostControllerTest {
|
|||
assertThat(model.getAttribute("nextCursorId")).isNull();
|
||||
}
|
||||
|
||||
/** 회귀(168671b): cursor=null·categoryId=null → PSQLException 없이 "posts-list" 반환. */
|
||||
@Test
|
||||
void list_nullCursorAndCategory_returnsPostsView() {
|
||||
PostController controller = controller();
|
||||
when(postsMapper.listPublishedKeyset(isNull(), isNull(), isNull(), eq(PAGE_SIZE + 1)))
|
||||
.thenReturn(List.of());
|
||||
lenient().when(postCategoriesMapper.listActive()).thenReturn(List.of());
|
||||
Model model = new ExtendedModelMap();
|
||||
|
||||
String view = controller.list(null, null, null, model);
|
||||
|
||||
assertThat(view).isEqualTo("posts-list");
|
||||
assertThat(model.getAttribute("hasNext")).isEqualTo(false);
|
||||
}
|
||||
|
||||
// ==== helpers ====
|
||||
|
||||
private PostController controller() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue