기본 그룹 insert sql 추가

This commit is contained in:
geek 2019-07-21 00:03:02 +09:00
parent 73b5ba7545
commit 1cc236a683
3 changed files with 23 additions and 6 deletions

View File

@ -12,11 +12,11 @@ spring:
data-username: postgres data-username: postgres
password: qwer5795 password: qwer5795
username: postgres username: postgres
# JPA properties # JPA properties
initialization-mode: never
jpa: jpa:
hibernate: hibernate:
ddl-auto: create-drop ddl-auto: update
database: postgresql database: postgresql
show-sql: true show-sql: true
database-platform: org.hibernate.dialect.PostgreSQLDialect database-platform: org.hibernate.dialect.PostgreSQLDialect

View File

@ -0,0 +1,14 @@
insert into public.tbl_user_group
(id ,title, description, is_default, register_date)
values
(1, '관리자', '관리자 그룹', false, '2019-07-20 12:00:30');
insert into public.tbl_user_group
(id ,title, description, is_default, register_date)
values
(2, '정회원', '정회원 그룹', true, '2019-07-20 12:00:30');
insert into public.tbl_user_group
(id ,title, description, is_default, register_date)
values
(3, '비회원', '비회원 그룹', false, '2019-07-20 12:00:30');

View File

@ -38,6 +38,8 @@ public class UserRepositoryTest {
@Test @Test
public void findByUsername() throws Exception { public void findByUsername() throws Exception {
User admin = this.userRepository.findByUsername("admin");
if (admin == null) {
User tempUser = user.build(); User tempUser = user.build();
this.userRepository.save(tempUser); this.userRepository.save(tempUser);
@ -46,6 +48,7 @@ public class UserRepositoryTest {
assertEquals("Equlas", user.build().getUsername(), user1.getUsername()); assertEquals("Equlas", user.build().getUsername(), user1.getUsername());
} }
}
@Test @Test
public void findByEmail() { public void findByEmail() {