diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b07092cb..1e6e0bcf 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -31,8 +31,6 @@ jobs: run: | mkdir -p ./core/src/main/resources/firebase echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/main/resources/firebase/firebase_account.json - mkdir -p ./core/src/test/resources/firebase - echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/test/resources/firebase/firebase_account.json # gradle 권한 부여 - name: Grant execute permission for gradlew diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60c76853..486b9136 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,8 @@ jobs: echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/main/resources/firebase/firebase_account.json mkdir -p ./core/src/test/resources/firebase echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./core/src/test/resources/firebase/firebase_account.json + mkdir -p ./api/src/test/resources/firebase + echo "${{ secrets.FIREBASE_ACCOUNT }}" | base64 -d > ./api/src/test/resources/firebase/firebase_account.json # gradle 권한 부여 - name: Grant execute permission for gradlew diff --git a/.gitignore b/.gitignore index 228560fc..b726fed7 100644 --- a/.gitignore +++ b/.gitignore @@ -38,8 +38,8 @@ out/ .DS_Store core/src/main/resources/application-core-dev.yml core/src/main/resources/application-core-prod.yml -application-core.yml /api/src/main/resources/application.yml /core/src/main/generated/ /core/src/main/resources/firebase/firebase_account.json /core/src/test/resources/firebase/firebase_account.json +/api/src/test/resources/firebase/firebase_account.json diff --git a/api/src/main/java/dev/handsup/HandsUpApplication.java b/api/src/main/java/dev/handsup/HandsUpApplication.java index 5d0098bd..c1be1152 100644 --- a/api/src/main/java/dev/handsup/HandsUpApplication.java +++ b/api/src/main/java/dev/handsup/HandsUpApplication.java @@ -1,13 +1,9 @@ package dev.handsup; -import java.util.TimeZone; - import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import jakarta.annotation.PostConstruct; - @EnableJpaAuditing @SpringBootApplication public class HandsUpApplication { diff --git a/api/src/main/java/dev/handsup/common/domain/CacheType.java b/api/src/main/java/dev/handsup/common/domain/CacheType.java index a4cfd6b9..ef0b0c97 100644 --- a/api/src/main/java/dev/handsup/common/domain/CacheType.java +++ b/api/src/main/java/dev/handsup/common/domain/CacheType.java @@ -4,12 +4,17 @@ @Getter public enum CacheType { + AUCTIONS( - "auctions", // 캐시 이름: users - 10 * 60, // 만료 시간: 5 분 - 10000 // 최대 갯수: 10000 + "auctions", // 캐시 이름: users + 10 * 60, // 만료 시간: 5 분 + 10000 // 최대 갯수: 10000 ); + private final String cacheName; + private final int expireAfterWrite; + private final int maximumSize; + CacheType( String cacheName, int expireSecondsAfterWrite, @@ -19,8 +24,4 @@ public enum CacheType { this.expireAfterWrite = expireSecondsAfterWrite; this.maximumSize = maximumSize; } - - private final String cacheName; - private final int expireAfterWrite; - private final int maximumSize; } diff --git a/api/src/test/resources/application.yml b/api/src/test/resources/application.yml index 89c2c9be..060e11e0 100644 --- a/api/src/test/resources/application.yml +++ b/api/src/test/resources/application.yml @@ -26,4 +26,4 @@ cloud: auto: false fcm: - certification: firebase/firebase_service_account.json + certification: firebase/firebase_account.json diff --git a/api/src/test/resources/firebase/firebase_service_account.json b/api/src/test/resources/firebase/firebase_service_account.json deleted file mode 100644 index 7841923a..00000000 --- a/api/src/test/resources/firebase/firebase_service_account.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "service_account", - "project_id": "hands-up-6a33b", - "private_key_id": "be18aed89999a93794e60111cd621b13d9bced4d", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCr5/Bxl81QUkWj\n+epgIQge7ED4ZwiNN0GV9+g/WxgSaDHfn73o/2nMVp8AbiE7F35HsaW0H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KuKOVvkuPgcMq7eIbJQURhNzDof1N6o4\nM0TATewPmlvcuZfRYJzpN66TJY3IxsRXOmVEoeiY0c3J3ZOAU4QlHnlJAoGAFSiL\n2//xyfREeqAozziscTGrAlYTIhZPZuCaHE65xwoVu0iPhncuYmZAepsEvWZLQpKE\nL0pr9SbxIBPSscot4FqEpwDMr7qwcp3E1z8015NdNrJaL5l2Ax1/JiyXStS4GTfP\nYFLGE+54T0pzPdus0jRs/wb3s/MXTeepOO0F0oMCgYADUP0qgPSa7DIP/bIWEGsI\nK8dnJSf5ghN9DgZqaYujj/jVNehOkPRTvqTh0njD2rsGcplP+msiSp0S+0PQHYJj\nH7FjSMzKRZv456cMFFN4EJ6GANzhOnOcn6n7+2aqnQ2ertyY79B9BLdfJw8DWKzC\nRppXK0rhRCOjBVT39fRluw==\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-ie1cy@hands-up-6a33b.iam.gserviceaccount.com", - "client_id": "106213486966534531441", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ie1cy%40hands-up-6a33b.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} -4 diff --git a/core/src/main/resources/firebase/firebase_service_account.json b/core/src/main/resources/firebase/firebase_service_account.json deleted file mode 100644 index 366935bc..00000000 --- a/core/src/main/resources/firebase/firebase_service_account.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "service_account", - "project_id": "hands-up-6a33b", - "private_key_id": "aea609814328e1847d89749b3969a11f854b1604", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDlEdxfwYNEKC1j\n9pmHz4VCWwR3pa7rEo1i7oifFrLKGUP5QUKljoABVcLl9MV62SLb/0vJ+50BkKY1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HIyklAI2rIQ+yA2VjAK9keBfomenFuhclc\nVzk47nHdx/kglJj4b6zvPYSeeLtk3g+6J/wI1tGoIlKsjdnyCdAxral1AoGBANpu\njy/v60zL8Ef1z4DeiOFoqspJUoZleuz1LCmBFeG8+42KWZs7JQwpSOCZT43dqcLb\nV3PAMXaCCrdRK6RaWYFRzoluz9BSgxCnqG2EVhO/K0LZA85HKWMfgx3F0GcEbtXn\nb5FPygj6UDU2iikEgh/7kaO0/JwBJMBBkynlywFFAoGAZJ8DTNRF6XfAtQT+S38F\ni3sZSpCXm5BRLw4nh0w4GkcFgp611IW0mQwSqdAuW8R9/8Iwc6k4qAbZaS3fHDvV\njhPSOU+sm6y5/3EOJPJcoaHtiip84M4Z2f6s1KUFrJWiXNkLVkVxku5aYG5VjR5g\njcB4yZ2Qh/VaWa/7PaLE1D8=\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-ie1cy@hands-up-6a33b.iam.gserviceaccount.com", - "client_id": "106213486966534531441", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ie1cy%40hands-up-6a33b.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} diff --git a/core/src/test/java/dev/handsup/bidding/repository/BiddingConcurrencyTest.java b/core/src/test/java/dev/handsup/bidding/repository/BiddingConcurrencyTest.java index 85d2523b..faa2028d 100644 --- a/core/src/test/java/dev/handsup/bidding/repository/BiddingConcurrencyTest.java +++ b/core/src/test/java/dev/handsup/bidding/repository/BiddingConcurrencyTest.java @@ -6,6 +6,7 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +57,7 @@ void setUp() { user = userRepository.save(UserFixture.user1()); } + @Disabled @DisplayName("[동시에 500개 요청 시, 입찰 금액이 모두 같다면 하나의 입찰만 저장된다.]") @Test void concurrency_test() throws InterruptedException { diff --git a/core/src/test/java/dev/handsup/notification/domain/service/FCMServiceTest.java b/core/src/test/java/dev/handsup/notification/domain/service/FCMServiceTest.java index 428c4794..48d7dfa8 100644 --- a/core/src/test/java/dev/handsup/notification/domain/service/FCMServiceTest.java +++ b/core/src/test/java/dev/handsup/notification/domain/service/FCMServiceTest.java @@ -1,6 +1,5 @@ package dev.handsup.notification.domain.service; -import static org.assertj.core.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.BDDMockito.*; @@ -15,11 +14,9 @@ import com.google.firebase.messaging.FirebaseMessagingException; import dev.handsup.auction.domain.Auction; -import dev.handsup.common.exception.NotFoundException; import dev.handsup.fixture.AuctionFixture; import dev.handsup.fixture.UserFixture; import dev.handsup.notification.domain.NotificationType; -import dev.handsup.notification.exception.NotificationErrorCode; import dev.handsup.notification.repository.FCMTokenRepository; import dev.handsup.notification.service.FCMService; import dev.handsup.notification.service.NotificationService; diff --git a/core/src/test/resources/firebase/firebase_service_account.json b/core/src/test/resources/firebase/firebase_service_account.json deleted file mode 100644 index 7841923a..00000000 --- a/core/src/test/resources/firebase/firebase_service_account.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "service_account", - "project_id": "hands-up-6a33b", - "private_key_id": "be18aed89999a93794e60111cd621b13d9bced4d", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCr5/Bxl81QUkWj\n+epgIQge7ED4ZwiNN0GV9+g/WxgSaDHfn73o/2nMVp8AbiE7F35HsaW0HPLWRLgY\n932bJ72HzqAA37oMPE69+LVv7qHkZLrpbZP0Q0xJ6GYdDVD3X/mtxb7P6qoYoDUA\n2QgKYjvBtEA8gnvH4YA0Nd93vMUopdnk3tpe1RWFlANL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IhZPZuCaHE65xwoVu0iPhncuYmZAepsEvWZLQpKE\nL0pr9SbxIBPSscot4FqEpwDMr7qwcp3E1z8015NdNrJaL5l2Ax1/JiyXStS4GTfP\nYFLGE+54T0pzPdus0jRs/wb3s/MXTeepOO0F0oMCgYADUP0qgPSa7DIP/bIWEGsI\nK8dnJSf5ghN9DgZqaYujj/jVNehOkPRTvqTh0njD2rsGcplP+msiSp0S+0PQHYJj\nH7FjSMzKRZv456cMFFN4EJ6GANzhOnOcn6n7+2aqnQ2ertyY79B9BLdfJw8DWKzC\nRppXK0rhRCOjBVT39fRluw==\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-ie1cy@hands-up-6a33b.iam.gserviceaccount.com", - "client_id": "106213486966534531441", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ie1cy%40hands-up-6a33b.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} -4