Skip to content

Commit

Permalink
test: final var 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
carsago committed Oct 1, 2023
1 parent f06e1e0 commit c013ba8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/src/test/java/com/techcourse/dao/UserDaoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.techcourse.config.DataSourceConfig;
import com.techcourse.domain.User;
import com.techcourse.support.jdbc.init.DatabasePopulatorUtils;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.jdbc.IncorrectRowSizeException;
Expand All @@ -20,20 +21,20 @@ void setup() {
DatabasePopulatorUtils.execute(DataSourceConfig.getInstance());

userDao = new UserDao(DataSourceConfig.getInstance());
final var user = new User("gugu", "password", "[email protected]");
User user = new User("gugu", "password", "[email protected]");
userDao.insert(user);
}

@Test
void findAll() {
final var users = userDao.findAll();
List<User> users = userDao.findAll();

assertThat(users).isNotEmpty();
}

@Test
void findById() {
final var user = userDao.findById(1L);
User user = userDao.findById(1L);

assertThat(user.getAccount()).isEqualTo("gugu");
}
Expand Down Expand Up @@ -79,11 +80,11 @@ void findByAcoount_throw_multiple_row() {

@Test
void insert() {
final var account = "insert-gugu";
final var user = new User(account, "password", "[email protected]");
String account = "insert-gugu";
User user = new User(account, "password", "[email protected]");
userDao.insert(user);

final var actual = userDao.findById(2L);
User actual = userDao.findById(2L);

assertThat(actual.getAccount()).isEqualTo(account);
}
Expand Down

0 comments on commit c013ba8

Please sign in to comment.