Skip to content

Commit 61ed522

Browse files
committed
feat : prod에 테스트용 100명 데이터 생성
1 parent 6922310 commit 61ed522

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- 옥정현/feat-181
78

89
paths:
910
- '.github/workflows/**'

backend/src/main/java/com/WEB4_5_GPT_BE/unihub/global/init/InitProdOrStgData.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ public void init() {
123123
"fourthstudent@auni.ac.kr", "studentPw", "정학생", "20231423",
124124
university.getId(), majorSW.getId(), 1, 1
125125
);
126+
127+
// 13) 4학년 1학기 수강신청 기간 생성
128+
helper.createEnrollmentPeriod(
129+
university,
130+
LocalDate.now().getYear(), 4, 1,
131+
LocalDate.of(2025, 5, 1),
132+
LocalDate.of(2025, 5, 30)
133+
);
134+
135+
// 14) 동시성 테스트용 데이터 생성 (4학년 학생 100명, 교수 1명, 강좌 1개)
136+
createTestDataForConcurrency(university, majorSW);
126137
}
127138

128139
/**
@@ -269,4 +280,28 @@ private void initNotices() {
269280
summerUrl
270281
);
271282
}
283+
284+
private void createTestDataForConcurrency(University university, Major majorSW) {
285+
for (int i = 1; i <= 100; i++) {
286+
helper.createStudent(
287+
"concurrencyStudent" + i + "@auni.ac.kr", "studentPw", "동시성학생" + i, "2504%04d".formatted(i),
288+
university.getId(), majorSW.getId(), 4, 1
289+
);
290+
}
291+
292+
Professor professor = (Professor) helper.createProfessor(
293+
"concurrencyProfessor@auni.ac.kr", "password", "동시성교수", "EMP250011",
294+
university.getId(), majorSW.getId(), ApprovalStatus.APPROVED
295+
);
296+
297+
// 자료구조
298+
Course dataStructure = helper.createCourse(
299+
"동시성과목", majorSW, "동시관 401호",
300+
30, 0, 3,
301+
professor,
302+
4, 1, "/plans/data-structure.pdf"
303+
);
304+
helper.createCourseScheduleAndAssociateWithCourse(dataStructure, DayOfWeek.MON, "09:00:00", "10:30:00");
305+
306+
}
272307
}

backend/src/main/resources/application-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spring:
1616

1717
jpa:
1818
hibernate:
19-
ddl-auto: update
19+
ddl-auto: create
2020
properties:
2121
hibernate:
2222
format_sql: false

0 commit comments

Comments
 (0)