Skip to content

Commit be08efa

Browse files
authored
Merge pull request #83 from Modagbul/fix/auth
fix: test시 빈을 찾을 수 없는 문제 해결
2 parents 1bbf1af + fd711b6 commit be08efa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/com/moing/backend/global/util/SlackService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import lombok.extern.slf4j.Slf4j;
77
import org.springframework.beans.factory.annotation.Value;
88
import org.springframework.scheduling.annotation.Async;
9+
import org.springframework.stereotype.Component;
910
import org.springframework.stereotype.Service;
1011

1112
import javax.servlet.http.HttpServletRequest;
@@ -16,7 +17,7 @@
1617

1718
import static com.slack.api.webhook.WebhookPayloads.payload;
1819

19-
@Service
20+
@Component
2021
@Slf4j
2122
public class SlackService {
2223

src/test/java/com/moing/backend/config/CommonControllerTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.moing.backend.global.config.security.filter.JwtAuthenticationEntryPoint;
99
import com.moing.backend.global.config.security.jwt.TokenUtil;
1010
import com.moing.backend.global.config.security.util.AuthenticationUtil;
11+
import com.moing.backend.global.util.SlackService;
1112
import org.junit.jupiter.api.BeforeEach;
1213
import org.junit.jupiter.api.extension.ExtendWith;
1314
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +33,7 @@
3233
@MockBean(JpaMetamodelMappingContext.class)
3334
@ExtendWith({RestDocumentationExtension.class, SpringExtension.class})
3435
public class CommonControllerTest {
36+
3537
@Autowired
3638
protected RestDocumentationResultHandler restDocs;
3739

@@ -56,6 +58,9 @@ public class CommonControllerTest {
5658
@MockBean
5759
public MemberGetService memberQueryService;
5860

61+
@MockBean
62+
private SlackService slackService;
63+
5964
@BeforeEach
6065
public void setUp(final WebApplicationContext context, final RestDocumentationContextProvider provider) throws Exception {
6166

0 commit comments

Comments
 (0)