게시글
질문&답변
2020.03.03
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
- 6.3K
질문&답변
2019.03.05
예제 에러 질문 드립니다.
어노테이션붙이고 상속도 받았는데 이런 에러가 발생합니다. 혹시 스프링부트 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
- 2K
질문&답변
2019.01.26
소스코드 에러
아 제가 수업듣기전에 소스코드만 열어봐서 당황했네요 정주행 시작하겠습니다!!
- 0
- 2
- 197