inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

상진님의 게시글

상진 상진

@tkdwlsdlzzz1820

수강평 작성수
1
평균평점
5.0

게시글 3

질문&답변

JunitParams 관련 질문 드립니다.

Junit5로 할때는 방법이 조금 바뀌었습니다. org.junit.jupiter junit-jupiter-params 5.4.2 test @ParameterizedTest @CsvSource ({ "0, 0, true" , "0, 100, false" , "100, 0, false" , }) public void testFree ( int basePrice , int maxPrice , boolean isFree) { Event event = Event. builder () .basePrice(basePrice) .maxPrice(maxPrice) .build() ; event.update() ; assertThat (event.isFree()).isEqualTo(isFree) ; } @ParameterizedTest @MethodSource ( "isOffline" ) public void testOffline (String location , boolean isOffline) { Event event = Event. builder () .location(location) .build() ; event.update() ; assertThat (event.isOffline()).isEqualTo(isOffline) ; } private static Stream isOffline () { return Stream. of ( Arguments. of ( " 강남역 " , true ) , Arguments. of ( null, false ) , Arguments. of ( "" , false ) ) ; }

좋아요수
3
댓글수
3
조회수
6512

질문&답변

예제 에러 질문 드립니다.

어노테이션붙이고 상속도 받았는데 이런 에러가 발생합니다. 혹시 스프링부트 2.1.2 버전을 사용해서 강의에서 사용하는 버전과 달라서일까요? 아니면 제가 DB로 mysql을 연결해서 쓰고있어서 그럴까요? 전체코드입니다 import naver.sangjin.demoinfleanrestapi.accounts.AccountService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.servlet.PathRequest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore; @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired AccountService accountService; @Autowired PasswordEncoder passwordEncoder; @Bean public TokenStore tokenStore() { return new InMemoryTokenStore(); } @Bean @Override public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(accountService) .passwordEncoder(passwordEncoder); } @Override public void configure(WebSecurity web) throws Exception { web.ignoring().mvcMatchers("/docs/index.html"); web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations()); } }

좋아요수
0
댓글수
2
조회수
2141

질문&답변

소스코드 에러

아 제가 수업듣기전에 소스코드만 열어봐서 당황했네요 정주행 시작하겠습니다!!

좋아요수
0
댓글수
2
조회수
294