Skip to content

Commit

Permalink
#50 application-test.properties 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
taeyeongKims committed Jan 13, 2025
1 parent 84cbacf commit cd5e5c8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
import com.example.api.domain.Account;
import com.example.api.exception.BusinessException;
import com.example.api.exception.ErrorCode;
import jakarta.transaction.Transactional;

import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;

import java.util.Collection;
Expand All @@ -29,7 +30,6 @@ public class AccountService {
private final CodeRepository codeRepository;
private final PasswordEncoder passwordEncoder;
private final MailSender mailSender;
private final AccountRepository accountRepository;

public Code sendEmail(@Validated final EmailRequest request) throws BusinessException {
// 이미 가입된 이메일인지 검증
Expand Down Expand Up @@ -70,7 +70,7 @@ public String signUp(@Validated final SignUpRequest request) {
return "회원가입이 완료되었습니다";
}

@org.springframework.transaction.annotation.Transactional(readOnly = true)
@Transactional(readOnly = true)
public Account loadAccount(final Long requestMemberId) {
return accountRepository.findById(requestMemberId)
.orElseThrow(() -> new BusinessException(ErrorCode.ACCOUNT_NOT_FOUND_EXCEPTION));
Expand Down Expand Up @@ -103,9 +103,4 @@ private void validateDuplicateEmail(final EmailRequest emailRequest) {
throw new BusinessException(ErrorCode.DUPLICATE_EMAIL);
}
}

public Account loadAccount(final Long requestMemberId) {
return accountRepository.findById(requestMemberId)
.orElseThrow(() -> new BusinessException(ErrorCode.ACCOUNT_NOT_FOUND_EXCEPTION));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public record PossibleDetails(
LocalDateTime possibleStartTime,
LocalDateTime possibleEndTime,
Long contractCount,
Double starPoint
Integer starPoint
) {
}
35 changes: 34 additions & 1 deletion src/test/resources/application-test.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
spring.config.import=optional:file:.env[.properties]

spring.jpa.hibernate.ddl-auto=create
spring.sql.init.mode=always
spring.sql.init.mode=always

# kakao Oauth2 ??
spring.security.oauth2.client.registration.kakao.client-id=${KAKAO_CLIENT_ID}
spring.security.oauth2.client.registration.kakao.client-secret=${KAKAO_CLIENT_SECRET}
spring.security.oauth2.client.registration.kakao.redirect-uri={baseUrl}/oauth2/callback/{registrationId}
spring.security.oauth2.client.registration.kakao.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.kakao.client-authentication-method=client_secret_post
spring.security.oauth2.client.registration.kakao.scope=profile_nickname,account_email

# kakao Oauth2 Provider ??
spring.security.oauth2.client.provider.kakao.authorization-uri=https://kauth.kakao.com/oauth/authorize
spring.security.oauth2.client.provider.kakao.token-uri=https://kauth.kakao.com/oauth/token
spring.security.oauth2.client.provider.kakao.user-info-uri=https://kapi.kakao.com/v2/user/me
spring.security.oauth2.client.provider.kakao.user-name-attribute=id

# naver Oauth2 ??
spring.security.oauth2.client.registration.naver.client-id=${NAVER_CLIENT_ID}
spring.security.oauth2.client.registration.naver.client-secret=${NAVER_CLIENT_SECRET}
spring.security.oauth2.client.registration.naver.redirect-uri={baseUrl}/oauth2/callback/{registrationId}
spring.security.oauth2.client.registration.naver.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.naver.client-authentication-method=client_secret_basic
spring.security.oauth2.client.registration.naver.scope=name,email

# naver Oauth2 Provider ??
spring.security.oauth2.client.provider.naver.authorization-uri=https://nid.naver.com/oauth2.0/authorize
spring.security.oauth2.client.provider.naver.token-uri=https://nid.naver.com/oauth2.0/token
spring.security.oauth2.client.provider.naver.user-info-uri=https://openapi.naver.com/v1/nid/me
spring.security.oauth2.client.provider.naver.user-name-attribute=response

# redirect allow path
app.oauth2.authorized-redirect-uris=*

0 comments on commit cd5e5c8

Please sign in to comment.