inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

메소드 빈주입

해결됨

토비의 스프링 부트 - 이해와 원리

안녕하세요 토비님 강의 잘듣고있습니다! 다름이 아니라 강의 내용중 메서드 파라미터에 빈을 주입 받아 사용하는 것에 궁금증이 생겨 질문드립니다. 일반 적으로 빈을 주입받아 사용할 때 @Autowired나 생성자 등으로 초기화를 해주었는데, 위의 코드의 매개변수는 그런 과정이 없이 바로 빈을 주입받는 것인가요 ?

  • spring-jdbc
  • spring
  • spring-boot
endeavor 댓글 1 좋아요 0 조회수 914

질문드립니다.

해결됨

토비의 스프링 부트 - 이해와 원리

안녕하세여 초보적인 질문드려서 죄송합니다.. Configuration ProxyBeanMethods 값을 false 를 주면 호출 할때마다 새로운 객체를 생성하게 되는데.. 다시 말해 싱글톤임을 보장 받을수 없게 되는걸로 이해하였습니다. 아마 false주는 경우는 없을듯합니다만 혹시 사례가 있을까요? '굳이' 라는 말을 강의에서 계속 하셔서 사례라고 하면 생각해봤을때 싱글톤의 단점인것을 보안하기 위해 사용되는건지? 아니면 성능적인것 때문에 그런지 궁금합니다. 마지막 내용에 spring 에 실제 사용된 내용으로 봤을떈, 단순한 Configuration 일땐 false를 주면 될듯한데. 디테일한 사례가 궁금합니다. 감사합니다.

  • spring
  • spring-boot
  • spring-jdbc
오개발 댓글 1 좋아요 0 조회수 535

셀레니움으로 네이버를 열고나서 갑자기 data;라는 주소로 바뀌고 내용이 사라집니다.

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

현재 코드는 아래와 같습니다. 자꾸 에러뜨는게 있어서 구글링하면서 2줄이 추가되었네요. options = Options() ## ERROR:device_event_log_impl.cc(218) 방지코드 options.add_argument('--no-sandbox') options.add_experimental_option("excludeSwitches", ["enable-logging"]) ## 화면 창 유지해주는 코드 options.add_experimental_option("detach", True) 그런데, 네이버 창이 떠서 잠시 머물다가 창이 꺼지진 않고 이렇게 바뀝니다. 주소가 data; 내용은없음.. 무엇이 문제일까요. 구글링해도 잘 못찾겠네요.

  • selenium
  • 웹-크롤링
  • python
  • beautifulsoup
쥰쓰 댓글 2 좋아요 0 조회수 1300

검색어 입력 관련

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

연습삼아 나라장터의 상단 부분에 셀레니움을 통해 특정 검색어를 입력 후 검색을 실행 하려합니다 관련하여, 해당페이지 접속 후 단순히 find.element를 통해 driver.find_element( By.ID ,"AKCKwd").sendkeys("검색어") 와같이 사용할 수는 없는 것 인지요?

  • beautifulsoup
  • python
  • 웹-크롤링
  • selenium
SANGYUN LEE 댓글 3 좋아요 1 조회수 537

광고상품 외 표기 문의드립니다.

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

안녕하세요. 답변 감사드립니다. 전체 코드를 첨부하여 다시 문의글 작성하였습니다. 쿠팡 광고상품과 로켓상품도 표기하고자 합니다. if len( link.select (".ad-badge-text")) > 0: print("광고상품") 를 아래와 같이 수정하면 될까요? 해봤는데 아무표기가 안되서요. if len( link.select ("span.badge rocket")) > 0: print("로켓상품") 그리고 광고상품 로켓상품 둘다 표현하고자 하면 아래와 같이 표기하면 될까요? if len( link.select (".ad-badge-text")) > 0: print("광고상품") elif len( link.select ("span.badge rocket")) > 0: print("로켓상품") 광고상품은 광고상품이라고 잘 표기가 되는게 로켓상품은 전혀 결과가 나오지 않아서요.

  • python
  • 웹-크롤링
suki 댓글 2 좋아요 2 조회수 448

자동 구성 정보 분리가 안됩니다.

미해결

토비의 스프링 부트 - 이해와 원리

안녕하세요 자동 구성 정보 분리쪽 강의를 따라 구현하던 도중 문제가 발생하여 질문을 남깁니다. return new String[]{ "tobyspring.config.autoconfig.TomcatWebServerConfig", "tobyspring.config.autoconfig.DispatcherServletConfig" }; 직접 경로를 작성해주는 경우에는 문제 없이 동작합니다. Iterable<String> candidates = ImportCandidates.load(MyAutoConfiguration.class, classLoader); return StreamSupport.stream(candidates.spliterator(), false).toArray(String[]::new); 클래스 로더를 이용해서 외부에서 파일 경로를 불러오는 방법을 사용하면 아래와 같은 문제가 발생합니다. 오후 11:26:47: Executing ':HellobootApplication.main()'... > Task :compileJava > Task :processResources UP-TO-DATE > Task :classes > Task :HellobootApplication.main() FAILED . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.8) 2023-02-27 23:26:49.370 INFO 3532 --- [ main] t.helloboot.HellobootApplication : Starting HellobootApplication using Java 17.0.6 on yj_notebook with PID 3532 (C:\git\TID\helloboot\build\classes\java\main started by deter in C:\git\TID\helloboot) 2023-02-27 23:26:49.374 INFO 3532 --- [ main] t.helloboot.HellobootApplication : No active profile set, falling back to 1 default profile: "default" 2023-02-27 23:26:49.641 WARN 3532 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.context.MissingWebServerFactoryBeanException: No qualifying bean of type 'org.springframework.boot.web.servlet.server.ServletWebServerFactory' available: Unable to start AnnotationConfigServletWebServerApplicationContext due to missing ServletWebServerFactory bean 2023-02-27 23:26:49.667 ERROR 3532 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context. Action: Check your application's dependencies for a supported servlet web server. Check the configured web application type. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings 3 actionable tasks: 2 executed, 1 up-to-date FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':HellobootApplication.main()'. > Process 'command 'C:/Users/deter/.jdks/azul-17.0.6/bin/java.exe'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2s 오후 11:26:49: Execution finished ':HellobootApplication.main()'. 제가 생각하기로는 클래스 로더를 통해서 구성 정보를 불러와야 하는데 못 불러오고 있는 것 같습니다. package tobyspring.config.autoconfig; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import tobyspring.config.MyAutoConfiguration; @MyAutoConfiguration public class TomcatWebServerConfig { @Bean public ServletWebServerFactory servletWebServerFactory() { return new TomcatServletWebServerFactory(); } } 이 문제를 해결하기 위해서 java 버전 11, 17 gradle 버전 7.6, 8.0 Build and run 을 Geadle, IntelliJ 파일 경로 수정 등 로 변경하는 방법들을 시도해봤지만 해결하지 못했습니다. 현재 제 개발 환경은 아래와 같습니다. IntelliJ버전은 2022.2.3 Community버전 spring boot 2.7.8 gradle 7.6 어디서 문제가 발생하는지 감을 잡을 수 없어서 문의드립니다.

  • spring-boot
  • spring
  • spring-jdbc
  • spring-jdbc
sdyj178 댓글 1 좋아요 0 조회수 3412

섹션 4 -> 그리디 , 결정문제 질문

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

안녕하세요! 강의 정말 잘 듣고 있습니다. 섹션 4를 풀다가, 어떤 문제를 그리디를 쓰고, 어떤문제를 결정알고리즘을 써야하는지 감이 잡히지 않아서 질문 드립니다. 답변해주시면 정말 감사하겠습니다!

  • 코딩-테스트
  • 코테 준비 같이 해요!
  • python
깨위 댓글 1 좋아요 0 조회수 268

이 문제에서 궁금한게있습니다.

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

ch[i] != 0라서 if문을 탐색하지않는다면 L에 해당하는 dfs함수는 뭘 반환하는건가요?? 반환하는게 안보일때는 return이 생략됐다고 생각하는건가요?

  • 코딩-테스트
  • python
  • 코테 준비 같이 해요!
코딩코딩코딩코 댓글 1 좋아요 0 조회수 355

로그인 폼을 만들고 로컬 스토리지에 jwt저장하기 강의에서 질문입니다!

해결됨

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트

import React, { useState } from "react"; import { Card, Button, Form, Input, notification } from "antd"; import { useHistory } from "react-router-dom"; import Axios from "axios"; import { SmileOutlined, FrownOutlined } from "@ant-design/icons"; import useLocalStorage from "utils/useLocalStorage"; export default function Login() { const history = useHistory(); const [jwtAccessToken, setJwtAccessToken] = useLocalStorage( "jwtAccessToken", "" ); console.log("loaded Token: ", jwtAccessToken); // 왜 이게 두번이나 출력되는 것이지? const onFinish = (values) => { async function fn() { const { username, password } = values; const data = { username, password }; try { //응답을 꼭 받아야 한다. 토큰을 받아야 하니까 const response = await Axios.post( "http://127.0.0.1:8000/accounts/token/", data, { headers: { "Content-Type": "application/json" } } ); // const { data: token } = response; 이런 방식은 아래랑 다르다 response에서 data을 꺼내서 이름을 token이라 짓는 것 // const token = response.data 와 일치하며 밑에 녀석은 // const jwtAccessToken = response.data.access 과 일치한다 const { data: { access: jwtAccessToken }, } = response; setJwtAccessToken(jwtAccessToken); notification.open({ message: "로그인 성공!", icon: <SmileOutlined style={{ color: "#108ee9" }} />, }); // history.push("/accounts/login"); //TODO: 이동주소 } catch (error) { console.log(error); if (error.response) { notification.open({ message: "로그인 실패!", icon: <FrownOutlined style={{ color: "#ff3333" }} />, description: "아이디/암호를 확인해 주세요.", onClick: () => { console.log("Notification Clicked!"); }, }); } } } fn(); }; return ( <Card title="login"> <Form labelCol={{ span: 8 }} //부트스트랩은 한 행이 12 컬럼인데 antd는 24컬럼임 wrapperCol={{ span: 16 }} style={{ maxWidth: 600 }} onFinish={onFinish} autoComplete="off" > <Form.Item label="Username" name="username" rules={[{ required: true, message: "Please input your username!" }]} //rules을 통해 유효성검사로직이 들어가 잇다 > <Input /> </Form.Item> <Form.Item label="Password" name="password" rules={[ { required: true, message: "Please input your password!" }, { min: 5, message: "5자리 이상 해주세요" }, // 한글자 한글자 들어갈때마다 검사해준다. ]} > <Input.Password /> </Form.Item> {/* //8칸 이동하고 16칸을 쓰겠다 */} <Form.Item wrapperCol={{ offset: 8, span: 16 }}> <Button type="primary" htmlType="submit"> Submit </Button> </Form.Item> </Form> </Card> ); } 안녕하세요 강사님!! 위에서 15번째 줄에 있는 console.log("loaded Token: ", jwtAccessToken); 이 부분이 페이지의 콘솔창에서 두번이나 나타납니다... 왜 그런지 알 수 있을까요?? 새로고침을 했을때도 두번 나타나고 submit을 했을 때도 2번 출력됩니다. 아 ! 그리고 simplejwt토큰을 사용중 입니다!

  • docker
  • django
  • python
  • react
꺼넝 댓글 1 좋아요 0 조회수 714

안녕하세요. 다른 풀이도 풀었는데 괜찮을까요?

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

정답은 제대로 나오긴 했는데 시간 초과라던가 하는 문제가 없을까요? 4중 for문은 생각지도 못했네요..ㅠㅠ sudoku = [list(map(int, input().split())) for _ in range(9)] def solution(sudoku): length = len(sudoku) a, b, c, = list(), list(), list() # 행열 검사 for i in range(length): row, col = list(), list() for j in range(length): row.append(sudoku[i][j]) col.append(sudoku[j][i]) if len(set(row)) != 9 or len(set(col)) != 9: return "NO" # 3x3 격자판 검사 a.extend(row[0:3]) b.extend(row[3:6]) c.extend(row[6:]) if i == 2 or i == 5 or i == 8: if len(set(a)) != 9 or len(set(b)) != 9 or len(set(c)) != 9: return "NO" a, b, c, = list(), list(), list() return "YES" print(solution(sudoku))

  • python
  • 코딩-테스트
  • 코테 준비 같이 해요!
HTCho1 댓글 1 좋아요 0 조회수 461

1068번: 트리

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

제가 다음과 같이 코드를 작성했는데, 100%까지 가다가 틀립니다.. 어떤게 문제일까요? 반례를 제시해주실 수 있나요? 감사합니다. https://www.acmicpc.net/problem/1068 import sys input = sys.stdin.readline n = int(input()) g = list(map(int, input().split())) m = int(input()) cnt = 0 def DFS(x): g[x] = -1 for i in range(n): if g[i] == x: DFS(i) DFS(m) for i in range(n): if g[i] != -1 and i not in g: cnt += 1 print(cnt)

  • python
  • 코딩-테스트
  • 코테 준비 같이 해요!
이도열 댓글 1 좋아요 1 조회수 376

spring: command not fount 왜 뜨는걸까요 ?

미해결

토비의 스프링 부트 - 이해와 원리

spring boot 가 설치되었다고 나오는데 spring 명령어를 치면 command not found 라고 뜨네요.. 혹시 해결방법이 없을까요 ?

  • spring
  • spring-boot
  • spring-jdbc
  • spring-jdbc
kjjmmm123 댓글 1 좋아요 0 조회수 824

안녕하세요 리뷰복습하다가, 발견했습니다

미해결

파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)

최근에 다시 자바스크립트로 돌리면서, 기존에 파이썬으로 했던 것들 다시 모두 자바스크립트로 풀어보면서 문제 풀어보니, 발견했습니다. 이거 첫번째 가정을, 그리디로 접근하면 해결 안되는 문제인것같습니다. 이후 가정들은 당연히 그리디 관념으로 최적값 찾을 수 있는데, 첫번째 가정부터 그리디로 접근하면 해결되는 문제가 아니라서 어긋나기때문에, 그리디관념이 통하지 않는 문제인것같습니다. 완전탐색해버리거나, 시간 더 줄이려면 백트래킹 가지치기 해야하는 문제인것같습니다. 입력입니다! 7 172 67 183 65 179 61 178 62 177 63 170 72 181 60 기존 풀이(무조건 183선발) 가 내주는 답 : 3 감독 현수가 원할 것 같은 답 : 6 그리디로 가장 키 큰 사람 무조건 선발하는 과정이 풀이에서 오류인것같습니다. 183 선발 가정하고 cnt 값 구하고, 그다음 181 선발 가정하고 cnt값 구하고, 쭉 다음 순으로 선발 가정하고 cnt값 구하는데, 만약 어떤 사람 선발 가정하고 cnt값 구하는데 남은 사람 수 다 합해도 기존 Max cnt보다 적을 경우, 백트레킹 가지치기로 break 혹은 return 끊어버리는게 맞는것같습니다. 풀이1. 이중포문 const input = require("fs") .readFileSync("input.txt") .toString() .trim() .split("\n"); const n = parseInt(input[0]); const arr = Array.from(Array(5), () => []); for (let i = 0; i < n; i++) { arr[i] = Array.from(input[i + 1].trim().split(" ")).map((v) => parseInt(v)); } function solution(n, arr) { arr.sort((a, b) => b[0] - a[0]); let cnt = 0; let largest = 0; let res = 0; for (let i = 0; i < n; i++) { largest = arr[i][1]; cnt += 1; if (res >= n - i) { break; } for (let j = i + 1; j < n; j++) { if (arr[j][1] > largest) { largest = arr[j][1]; cnt += 1; } } res = Math.max(res, cnt); cnt = 0; } console.log(res); } solution(n, arr); 풀이2. DFS const input = require("fs") .readFileSync("input.txt") .toString() .trim() .split("\n"); const n = parseInt(input[0]); const arr = Array.from(Array(5), () => []); for (let i = 0; i < n; i++) { arr[i] = Array.from(input[i + 1].trim().split(" ")).map((v) => parseInt(v)); } let cnt = 0; let res = 0; //const list = []; function DFS(s, weight) { if (s < 0) return; if (cnt + n - s <= res) { cnt -= 1; s -= 1; return; } for (let i = s; i < n; i++) { if (arr[i][1] > weight) { cnt += 1; //list.push(arr[i][1]); DFS(i + 1, arr[i][1]); //list.pop(); } } res = Math.max(res, cnt); //console.log(list); cnt -= 1; } function solution(n, arr) { arr.sort((a, b) => b[0] - a[0]); DFS(0, 0); console.log(res); } solution(n, arr);

  • python
  • 코딩-테스트
  • 코테 준비 같이 해요!
ncprog1 댓글 2 좋아요 1 조회수 455

로드맵상 다음강의? 크롤링? 퀀트1?

해결됨

문과생도, 비전공자도, 누구나 배울 수 있는 파이썬(Python)!

안녕하세요.. 멋지고 깔끔한 강의 덕분에 2주만에 완강했습니다! 좋은 강의 준비해주셔서 감사합니다. 로드맵상 다음강의가 퀀트part1 으로 되어 있는데, 크롤링을 모르고 가도 상관이 없을까요? 아니면 크롤링 강의 먼저 듣고 가는게 나을까요?

  • python
wk 댓글 1 좋아요 0 조회수 272

jsconfig 오류 질문입니다!

해결됨

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트

{ "compilerOptions": { "baseUrl": "src" }, "include": ["src"] } keonhongkoo@keonhongui-MacBookAir frontend % yarn start yarn run v1.22.19 $ react-scripts start node:internal/modules/cjs/loader:1325 throw err; ^ SyntaxError: /Users/keonhongkoo/Desktop/instagram/frontend/jsconfig.json: Unexpected token / in JSON at position 75 at parse (<anonymous>) at Module._extensions..json (node:internal/modules/cjs/loader:1322:39) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) at getModules (/Users/keonhongkoo/Desktop/instagram/frontend/node_modules/react-scripts/config/modules.js:126:14) at Object.<anonymous> (/Users/keonhongkoo/Desktop/instagram/frontend/node_modules/react-scripts/config/modules.js:142:18) at Module._compile (node:internal/modules/cjs/loader:1254:14) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) Node.js v18.14.1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 이렇게 결과가 출력되는데 해결책이 안보이네요... vscode도 재시작해봤습니다ㅠ

  • docker
  • python
  • react
  • django
꺼넝 댓글 1 좋아요 0 조회수 809

질문드립니다.

미해결

남박사의 파이썬 기초부터 실전 100% 활용

사용자 입력 예외처리를 하고 있는데, 1)문자 입력 시 오류 2)3자리 숫자가 아닐 경우 오류 다음과 같이 코드를 짰는데 1)의 경우 except 부분에서 "입력 오류"를 출력하지만 2)의 경우 "입력오류"가 출력되지 않고 그냥 재입력하게 되네요. 혹시 이유를 알 수 있나요? 또한 문자 입력 시 "숫자만 입력 가능합니다"를 출력 두자리수 입력 시 "세 자리 수를 입력하세요"를 출력 하도록 하려면 코드를 어떻게 수정해야 할까요? 감사합니다.! #세 자리 숫자만 입력할 수 있게 하는 함수 def input_check(msg, casting = int): while True: try: num = input(msg) # 사용자 입력 num_str = str(num) #맨 앞의 수가 0일경우 0이 잘려버리기 때문에 str을 따로 저장 if(casting(num) and len(num) == 3): return num_str except: print("입력 오류") continue

  • 웹-크롤링
  • 웹-크롤링
  • python
Poki 댓글 2 좋아요 1 조회수 404

아나콘다 버전 관련 문의 드립니다~!

미해결

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트

안녕하세요~! 아나콘다를 설치하면서 두가지 정도 질문이 있습니다 1) 2023.02.22날짜로 아나콘다 최신판을 설치하는데 그림과 같이 옵션사항에 환경변수 체크가 되지 않습니다 ㅠㅠ 업데이트 되면서 바뀐것인지 아나콘다 최신판에서 이 옵션을 선택하지 않아도 괜찮을까요?? 2) 2023.02.22날짜로 아나콘다 최신판에서는 파이썬 버전이 3.9버전인데 파이썬 공식버전으로는 3.11까지 배포가 되었습니다 버전 차이가 많이 나도 아나콘다를 설치하는게 사용에 더 편리할까요??

  • python
  • django
  • docker
  • react
서성길 댓글 3 좋아요 0 조회수 1297

테스트에서의 @Transactional 사용에 대해 질문이 있습니다.

해결됨

토비의 스프링 부트 - 이해와 원리

안녕하세요 토비 선생님! 강의 너무 재밌게 잘 듣고 있습니다. 이제 몇개 남지 않아서 많이 아쉽네요. 다름이 아니라 테스트 코드 작성시 `@Transactional` 어노테이션의 사용에 대해 질문이 있습니다. 저는 롤백테스트 작성을 위해 @Transactional 을 애용해왔는데요,, 얼마전 업무를 보다가 이상하게 테스트 코드는 잘만 통과를 하는데 같은 코드가 서버에 띄웠을때는 의도대로 동작을 안하더라고요. 한참을 씨름하다 알고보니 엔티티를 변경하고 JPA 변경감지로 변경하도록 의도한 코드인데 트랜잭션 경계 밖에서 변경을 하고 있었더라고요. 이후로는 찾아보니 테스트 코드에서 @Transactional을 사용하지 말라는 이야기가 많아 안쓰려고 노력을 해보는데 테스트 후 전부 롤백시키는게 만만치가 않더라고요. @AfterEach로 리포지터리를 다 불러와서 하나씩 돌려놓는것도 일이고.. 개인적으로는 @Transactional 대신에 단순히 전체 테스트에 대해 DB 롤백을 해주는 어노테이션이 별개로 있었으면 더 좋지 않았을까 하는 아쉬움도 있더라고요. 스프링에서 굳이 서로 다른 용도의 기능을 하나의 어노테이션으로 공유하는 이유가 있을까요? 트랜잭션 경계라는 점에서는 공통점이 있다지만 각각의 기능으로 분리되었어도 되지 않았을까요? AfterEach 넣어서 리포지터리 하나하나 불러와 일일히 초기화 해 주는 대신 @Transactional 만큼 코드가 깔끔해지면서 테스트코드에 @Transactional을 쓰면 생기게 되는 문제를 해결하는 방법이 있을까요? 혹은 사실 알고보면 테스트에 @Transactional을 쓰는게 좋은건데 제가 잘못 오해하고 있었을까요? 요즘 테스트 코드를 작성할때마다 고민이 많았는데 제가 한동안 검색한 결과로는 쉽게 결론을 내기가 힘들었습니다. 더 나은 코드작성에 꼭 도움이 필요해서 실례를 무릅쓰고 질문글을 올려봅니다. 감사합니다.

  • spring-boot
  • spring-jdbc
  • spring
shanePark 댓글 3 좋아요 32 조회수 7651

ApplicationContextRunner

해결됨

토비의 스프링 부트 - 이해와 원리

ApplicationContextRunner를 사용하는 부분에서 assertThat(context).hasSingleBean이랑 asserThat(context).doesNotHaveBean 사용이 안되네요 hasSingleBean이랑 doesNotHaveBean이 없어요 버전 문제일까요 지금까지 다 잘 따라왔는데 뭔가 문제인지 모르겠네요

  • spring
  • spring-boot
  • spring-jdbc
  • spring-jdbc
돈우 댓글 2 좋아요 0 조회수 710

인기 태그

인프런 TOP Writers

주간 인기글