Slide 47
Slide 47 text
© 2024 Loglass Inc.
@Test
void testUpdateTask() {
// given
jooq.insertInto(TASKS, TASKS.ID, TASKS.TITLE, TASKS.DESCRIPTION)
.values(1, "title", "description").execute();
// when
updateTaskUseCase.execute(new UpdateTaskCommand(1, "new title", "new
description"));
// then
Record3 actual = jooq
.select(TASKS.ID, TASKS.TITLE, TASKS.DESCRIPTION)
.from(TASKS).where(TASKS.ID.eq(1)).fetchOptional().get();
Assertions.assertEquals("new title", actual.get(TASKS.TITLE));
Assertions.assertEquals("new description", actual.get(TASKS.DESCRIPTION));
}
Application層の統合テスト
2. 統合テストの基礎知識
ID1のタスクを更新したい!
(given, when)