Skip to content

Commit

Permalink
fix: OSIV false 설정으로 인한 스케줄링 메서드 트랜잭션 선언 (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeon0208 authored and mzeong committed Oct 2, 2024
1 parent 5920507 commit f75fef3
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
76 changes: 76 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
plugins {
id 'java'
id 'jacoco' //테스트 커버리지 검증 라이브러리 추가
id 'org.springframework.boot' version '3.3.1'
id 'io.spring.dependency-management' version '1.1.5'
}

group = 'com.ody'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

jacoco {
toolVersion = '0.8.8'
}

jacocoTestReport {
jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(true)
}
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'com.google.firebase:firebase-admin:9.2.0'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'
implementation 'com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "io.jsonwebtoken:jjwt:0.9.1"
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

runtimeOnly 'com.mysql:mysql-connector-j:8.4.0'
runtimeOnly 'com.h2database:h2'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured:5.3.1'

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly 'com.h2database:h2'

annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'

implementation 'org.flywaydb:flyway-mysql'
implementation 'org.flywaydb:flyway-core'
}

tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

configurations.all {
exclude group: 'commons-logging', module: 'commons-logging'
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void scheduleNotification(FcmGroupSendRequest fcmGroupSendRequest) {
);
}

@Transactional
@EventListener(ApplicationReadyEvent.class)
public void schedulePendingNotification() {
List<Notification> notifications = notificationRepository.findAllByTypeAndStatus(
Expand All @@ -92,7 +93,10 @@ public void schedulePendingNotification() {

@DisabledDeletedFilter
public NotiLogFindResponses findAllMeetingLogs(Long meetingId) {
List<Notification> notifications = notificationRepository.findAllMeetingLogsBeforeThanEqual(meetingId, LocalDateTime.now());
List<Notification> notifications = notificationRepository.findAllMeetingLogsBeforeThanEqual(
meetingId,
LocalDateTime.now()
);
return NotiLogFindResponses.from(notifications);
}

Expand Down

0 comments on commit f75fef3

Please sign in to comment.