인프런 커뮤니티 질문&답변

jda0526님의 프로필 이미지
jda0526

작성한 질문수

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

회원 기능 테스트

java.lang.NullPointerException: Cannot invoke because is null 이 떠요

해결된 질문

작성

·

7.1K

·

수정됨

-2

강의를 보며 따라하면서 기존 클래스들을 변형하여 진행할 때 test 코드 작성 시 다음과 같이 에러가 뜹니다

처음에는 이런 문구가 뜨고 스프링부트 3.x 를 쓰고있어서 @ExtendWith(SpringExtension.class) //junit 5 로 변경하고 나서야 다음과 같은 문구가 뜹니다.

강의에서 @RequiredArgsConstructor 를 쓰면 final을 선언해줘야한다고 해서 강의와 동일하게 진행했으나 service의 join에서 null값이 생기는 것 같은데 어디가 문제인지 모르겠습니다.

java.lang.NullPointerException: Cannot invoke because "this." is null

build.grable 은 다음과 같습니다.

plugins {
	id 'java'
	id 'org.springframework.boot' version '3.0.7'
	id 'io.spring.dependency-management' version '1.1.0'
}

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-validation' //유효성 검증
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' //web view
	implementation 'org.springframework.boot:spring-boot-starter-web'
	compileOnly 'org.projectlombok:lombok'
//	runtimeOnly 'com.mysql:mysql-connector-j'
	runtimeOnly 'com.h2database:h2'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
//	testImplementation 'org.springframework.security:spring-security-test'


//JUnit4 추가
testImplementation("org.junit.vintage:junit-vintage-engine") {
	exclude group: "org.hamcrest", module: "hamcrest-core"
}
}

test {
	useJUnitPlatform()
}

tasks.named('test') {
	useJUnitPlatform()
}

User

package domain;

import jakarta.persistence.*;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Entity
@Getter @Setter
//@NotNull
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", updatable = false)
    private Long id;  //auto increment

    @Column(name = "email", nullable = false)
    private String email; //id

    @Column(length = 200 ,name ="password")
    private  String password;

    @Column(name = "name", nullable = false)
    private  String name;

    @Column(name= "phone" ,nullable = false )
    private String phone;

    @Builder
    public User(){
        this.email =email;
//        this.name=name;
    }

}

UserRepository

package domain;

import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserRepository {

    @PersistenceContext
    private EntityManager em;

    public void save(User user){
        em.persist(user);
    }

    public User findOne(String email) { //email 값으로 멤버값 반환
        return  em.find(User.class, email);
    }

    //리스트조회
    public List<User> findAll(){
        return em.createQuery("select u from User u", User.class)
                .getResultList();
    }

    //특정값으로 조회
    public List<User> findByName(String name) {
        return em.createQuery("select u fromUser u where u.name = :name",
                        User.class)
                .setParameter("name", name)
                .getResultList();
    }
}

UserService

package domain;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor //final있는 field 로 생성자
public class UserService {

    private final UserRepository userRepository;


//    @Transactional
    public String join(User user){
        validateDuplicateMember(user); // 중복 회원 검증
        userRepository.save(user); //error : line 13 선언변수 그대로 가져와야함
        return user.getEmail();
    }
    private void validateDuplicateMember(User user){
        List<User> findUsers = userRepository.findByName(user.getName());
        if(!findUsers.isEmpty()) {
            throw new IllegalStateException("이미 존재하는 회원입니다.");
        }
    }

}

UserServiceTest

package domain;

import org.junit.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

import static org.junit.Assert.assertEquals;


//메모리 모드 DB 연계 테스트
//@RunWith(SpringRunner.class) //junit 4
@ExtendWith(SpringExtension.class) //junit 5
@SpringBootTest
@Transactional //rollback
public class UserServiceTest {
    @Autowired UserService userService;
    @Autowired UserRepository userRepository;

    @Test
    public void 회원가입() throws Exception {
        //Given
        User user = new User();
        user.setEmail("fitplace@naver.com"); //email 로 검증 -> name은 중복 존재 가능성 o

        //When
        String saveEmail = userService.join(user);

        //Then
        assertEquals(user, userRepository.findOne(saveEmail));
    }

//    @Test(expected = IllegalStateException.class)
//    public void 중복_회원_제외() throws Exception {
//        //Given
//
//        //When
//
//        //Then
//
//    }
//

}

 

답변 3

0

보내주신 코드 잘 살펴봤습니다.

제가 findByEmail()의 결과값을 반환할 때 편의를 위해 User 타입으로 반환하기 위해 getSingleResult()를 사용해서 그런 것 같습니다. getSingleResult()는 해당 JPQL 에 대한 결과값이 존재하지 않을 때 EmptyResultDataAccessException을 반환합니다.

쉽게 고치기 위해서 영한님께서 강의에서 하셨던 것처럼 List<User> 타입으로 반환하도록 .getResultList()를 사용하겠습니다.

public List<User> findByEmail(String email) {
        return em.createQuery("select u from User u where u.email = :email", User.class)
                .setParameter("email", email)
                .getResultList();
}

이제 findByEmail을 사용하는 부분을 전부 수정하면 될 것 같습니다!

//UserService
private void validateDuplicateMember(User user){
    List<User> findUser = userRepository.findByEmail(user.getEmail());
    if(!findUser.isEmpty()) {
        throw new IllegalStateException("이미 존재하는 회원입니다.");
    }
}
    //UserServiceTest
    @Test
    public void 회원가입() throws Exception {
        //Given
        User user = new User();
        user.setEmail("fitplace@naver.com"); //email 로 검증 -> name은 중복 존재 가능성 o
        user.setName("김핏플");
        user.setPhone("01011112222");

        //When
        String saveEmail = userService.join(user);

        //Then
        User result = userRepository.findByEmail(saveEmail).get(0);
        assertEquals(user.getEmail(), result.getEmail());
        assertEquals(user.getName(), result.getName());
        assertEquals(user.getPhone(), result.getPhone());
    }

그리고 application-secret.yml에서 spring.datasource.url 에 있는 값들 중 MVCC=true는 사용하고 계신 H2 2.1.214 버전에서는 사용하지 않는 값이니 제거해주십시오!

spring:
    datasource:
        url: jdbc:h2:tcp://localhost/~/test

여기까지 해보시면 될 것 같습니다!

jda0526님의 프로필 이미지
jda0526
질문자

감사합니다. 성공했어요

imageㅠㅠㅠㅠ복받으실거에여 화이팅!

파이팅입니다!

0

첨부해주신 예외와 보내주신 코드 살펴보았습니다!

근본적인 원인은 UserService와 UserRepository가 빈으로 등록되지 않아서 발생한 문제입니다. @Service, @Repository를 붙이면 컴포넌트 스캔을 통해 자동으로 스프링 빈으로 등록되도록 하려면, 해당 빈들이 컴포넌트 스캔 대상이 되어야 합니다.

현재 보내주신 코드를 보니 해당 프로젝트를 학습 코드 && 사이드 프로젝트를 위한 서버 애플리케이션으로 사용하실 것 같습니다. 사이드 프로젝트에서 사용하기 위해 코드를 변경하는 과정에서 @SpringBootApplication이 붙은 메인 클래스의 위치를 다른 곳으로 옮기셨습니다.

스프링 부트는 기본적으로 @SpringBootApplication이 붙은 메인클래스를 기준으로 컴포넌트 스캔을 하게 됩니다. 예를 들어서 설명해보겠습니다.

@SpringBootApplication이 붙은 클래스를 임의로 MainApplication.java라고 하겠습니다. MainApplication.java가 src/main/java 안의 a.b 패키지 안에 있다고 하겠습니다.

  • a.b.MainApplication

그러면 컴포넌트 스캔의 대상이 되려면 a.b 패키지 혹은 a.b의 하위 패키지에 있어야 합니다.

  • a.b.UserService => 컴포넌트 스캔 대상

  • a.b.c.UserService => 컴포넌트 스캔 대상

  • a.c.UserService => 컴포넌트 스캔 대상 X

현재 프로젝트에서는 위의 이유로 UserService와 UserRepository가 컴포넌트 스캔 대상이 되지 못했고 스프링 빈으로 등록되지 못했기 때문에, @SpringBootTest에서 실패하는 것으로 보입니다. 이러한 에러는 스프링 빈에 대한 이해가 있어야 해결할 수 있습니다. 영한님의 스프링 MVC 1편을 꼭! 수강해주시기 바랍니다.

간단하게 domain 패키지 전체를 해당 메인 클래스가 있는 곳으로 옮겨주면 설정과 관련된 에러는 해결됩니다!(src/test/java 쪽 UserServiceTest도 src/main/java에서 옮겨준 위치와 똑같이 맞춰주십쇼!!)

추가적으로 발생하는 에러들은 다음과 같습니다.

  1. userRepository의 findByName()에서 JPQL에 오타가 있습니다. fromUser -> from User로 띄어쓰기 해주십시오.

  2. User Entity에 매핑되는 테이블 이름을 users와 같이 바꿔주십시오. DB는 미리 자기들이 쓰는 단어들을 예약어로 지정해놓습니다. user 또한 예약어에 해당하기 때문에 그대로 사용하지 못하는 DB들이 많습니다. @Table(name="users") 애노테이션을 User 클래스 위에 붙여주십시오!

  3. User 엔티티에 nullable=false로 해놓은 값들을 회원가입 테스트 코드에서 다 값을 할당해주십시오. email 뿐만 아니라, name, phone도 해주셔야 합니다. 그리고 builder는 지워주십시오. 잘못된 코드입니다.

  4. UserService의 join 메서드 위에 @Transactional도 주석 해제해주십시오. DB에 쓰기 작업을 하기 위해서는 읽기전용 트랜잭션을 적용하면 안됩니다!

  5. 그리고 join 메서드의 반환값이 이메일이고 검증할 때 그 값을 이용하기 위해서는 em.find()를 사용해서 만드는 것이 아니라 findByName 처럼 JPQL로 findByEmail을 만들어주셔야 합니다. 예시 코드는 다음과 같습니다.

public User findByEmail(String email) {
        return em.createQuery("select u from User u where u.email = :email", User.class)
                .setParameter("email", email)
                .getSingleResult();
}
  1. 이제 join 메서드의 반환값으로 받은 email 값 + 5.에서 만든 userRepository.findByEmail()을 이용해서 불러온 user와 join의 파라미터에 사용한 user 의 속성 값들을 비교하는 테스트를 작성하시면 될 것 같습니다.

 

여기까지 하시면 아마 테스트 성공 을 보시게 될 것 같습니다!

image

 

차근차근 해보시면 다 해결하실 수 있을거라 믿습니다!

파이팅입니다!

jda0526님의 프로필 이미지
jda0526
질문자

답변처럼 순차적으로 변경하던 중

제가 이해한 부분이 틀린 것 같아 번거로우시겠지만 재질문 드립니다.

  1. 에서 진행할 때 막히는 부분입니다.

     

    UserRepository에서 예시로 주신 코드를 입력 한 후 join에서 유효성 검증을 진행할 때

findByEmail을 사용하려합니다. 예외처리코드 작성 중 isempty에서 다음과 같이 발생합니다.

밑의 두 화면은 UserRepository / UserService 입니다.

imageisempty에서 옵션을 봤을 때 이와 같이 나옵니다

혹시 메소드를 추가해야하는 건가요 ?

아니면 코드 문법 상 제가 놓치고 잘못적은 부분이 있을까요 ..?

image

저는 아마 현재 코드에서는 validateDuplicateMember() 에서 findUser가 있는지 체크하는 로직을 findUser == null 로 체크할 것 같습니다.

private void validateDuplicateMember(User user) {
  User findUser = userRepository.findByEmail(user.getEmail());
  if (findUser == null) {
    throw new IllegalStateException("이미 존재하는 회원입니다.");
  }
} 

 

추가적으로 발생했던 에러들은 그냥 가볍게 에러를 해결할 수 있는 수준에서 말씀드렸던 것이라 jda0526님께서 원하시는 요구사항과 부합하지 않는 부분이 있을 수 밖에 없습니다 :) 너무 제가 말씀드린 것에 매몰되기 보다는 스프링에 대한 학습을 바탕으로 얻은 지식으로 더 멋진 코딩하시기 바랍니다!

파이팅입니다!

jda0526님의 프로필 이미지
jda0526
질문자

https://drive.google.com/file/d/1xvtdWNvACKF2VtiK2vLIlPu6pxxGycPO/view?usp=sharing

구글링을 통해 참고 블로그를 봤으나 여전히 감이 잡히지않습니다.

참고한 블로그 -> https://mr-popo.tistory.com/114 , https://soye0n.tistory.com/51

번거로우시겠지만 구글드라이브를 통해 전체코드를 올렸습니다.

 

1. 문제 영역을 실행할 수 있는 방법

Userservicetest 에서 실행합니다

2. 문제가 어떻게 나타나는지에 대한 상세한 설명

UserRepository의 JPQL 쿼리문에서 오류가 발생합니다.

오류 발생문구는 다음과 같습니다

image

처음 debug 했을때 아래와 같은 오류문구가 뜨고 이후 run이나 debug 시 userservicetest1로 진행되며 위와 같은문구가 뜹니다

image

0

안녕하세요. jda0526님, 공식 서포터즈 y2gcoder입니다.

먼저 말씀드리는 방식으로 해결할 수 있는지 시도해주시겠습니까?

스프링 부트 3버전부터는 사실 JUnit4를 사용할 필요가 없습니다. JUnit5를 그대로 사용하도록 변경해보겠습니다.

  1. build.gradle에서 JUnit4를 사용하는 부분과 중복된 test task를 지우겠습니다. (하시고 나서 gradle refresh 잊지 말아주십쇼!)

plugins {
	id 'java'
	id 'org.springframework.boot' version '3.0.7'
	id 'io.spring.dependency-management' version '1.1.0'
}

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-validation' //유효성 검증
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' //web view
	implementation 'org.springframework.boot:spring-boot-starter-web'
	compileOnly 'org.projectlombok:lombok'
//	runtimeOnly 'com.mysql:mysql-connector-j'
	runtimeOnly 'com.h2database:h2'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
//	testImplementation 'org.springframework.security:spring-security-test'


}

test {
	useJUnitPlatform()
}
  1. UserServiceTest에서도 @ExtendWith과 같은 부분은 이제 필요 없으니 지워주세요!(@SpringBootTest 내에 포함되어있습니다.)

이후에 다시 한 번 UserServiceTest를 실행해보시겠습니까?

 

감사합니다.

jda0526님의 프로필 이미지
jda0526
질문자

동일한 오류가 발생합니다

build refresh에서는 문제없으나 UserServiceTest를 실행하면 다음과 같이 뜹니다.

"C:\Program Files\Java\jdk-17\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar=57076:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit-rt.jar;C:\Users\duath\FitPlace_BE\server\out\test\classes;C:\Users\duath\FitPlace_BE\server\out\production\classes;C:\Users\duath\FitPlace_BE\server\out\production\resources;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.7\29ed7c24fd710adb11c216840860045946b7fa3e\spring-boot-starter-data-jpa-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\3.0.7\7433d4400479c9190aa59bf399357c9c749d20c8\spring-boot-starter-validation-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-thymeleaf\3.0.7\cdf465d29c9549bc7c215e890717bbbf64510bf1\spring-boot-starter-thymeleaf-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.7\6fd83cc63305158f43e1ccb5d218cb64a5a07306\spring-boot-starter-web-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\junit\junit\4.13.1\cdd00374f1fee76b11e2a9d127405aa3f6be5b6a\junit-4.13.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-test\3.0.7\8c3767d0dc2e5c634fcea7c88ffb2f0b15d7d161\spring-boot-starter-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.7\8ed272d1ea64fd34b25e272426a61c1381251679\spring-boot-starter-aop-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.7\bf69e667f79b929b41c5bf1d3921befea6f5c83d\spring-boot-starter-jdbc-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.7.Final\343f47b34c96fe9c44bf9b219a7b3c5d6d2fc90e\hibernate-core-6.1.7.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.6\8cb5c5f4fbeec3291051eccec948142ed57e4de2\spring-data-jpa-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.9\3b06099725350189816fcfad01834450378500ca\spring-aspects-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.7\5fe8a6a2e71bbfce6ab717214bb8b7d0e726ccda\spring-boot-starter-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.8\6f3a4ae2ae37270eeb6e9bec4e7207facdc9e8fa\tomcat-embed-el-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\8.0.0.Final\8e0389f22a3a246915a3311877da4168256b95d2\hibernate-validator-8.0.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf-spring6\3.1.1.RELEASE\deb52ef921a4ac5132fedb7ebfc2bc1dad4382b3\thymeleaf-spring6-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.7\31f75f791f960d75e4792124ddf6e67763ebb4a8\spring-boot-starter-json-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.7\b2c4286c147c72cb3885981911128dd79ebb59c2\spring-boot-starter-tomcat-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.9\e127c07a23403832d0c6292f4a0bf8c7a2b7329f\spring-webmvc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.9\2837dec8a75ecfdad367d6c30ce9cbdfc89caa7a\spring-web-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest-core\2.2\3f2bd07716a31c395e2837254f37f21f0f0ab24b\hamcrest-core-2.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test-autoconfigure\3.0.7\511b8a00015bfccaf926e1500e7c927416cdd1b2\spring-boot-test-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test\3.0.7\33f86c8c1002f6de27414a55a2a6f484cc117a2b\spring-boot-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.jayway.jsonpath\json-path\2.7.0\f9d7d9659f2694e61142046ff8a216c047f263e8\json-path-2.7.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.assertj\assertj-core\3.23.1\d2bb60570f5b3d7ffa8f8000118c9c07b86eca93\assertj-core-3.23.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter\5.9.3\72e840501e1550e9799c9a5cc9483d7d6b29e0ba\junit-jupiter-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-junit-jupiter\4.8.1\e393aa62eca2244a535b03842843f2f199343d1f\mockito-junit-jupiter-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-core\4.8.1\d8eb9dec8747d08645347bb8c69088ac83197975\mockito-core-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.skyscreamer\jsonassert\1.5.1\6d842d0faf4cf6725c509a5e5347d319ee0431c3\jsonassert-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-test\6.0.9\f50dd9d3b153dd2f56fa760f1cf8247f56f1ad45\spring-test-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.9\284ed111fa0b49b29f6fea6ac0afa402b809e427\spring-core-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.xmlunit\xmlunit-core\2.9.1\e5833662d9a1279a37da3ef6f62a1da29fcd68c4\xmlunit-core-2.9.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.9\8c1025bf9c1dc66f5268639866b5a45ed9bc62ef\spring-aop-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.9\814fe718b4d17187081c8efa66aaad7754d4675b\spring-jdbc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.9\be88c57829b9ec038774b47c241ac45673352a55\spring-context-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.9\b211685d9f7499402b74f02a5b32447032095ac6\spring-orm-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.6\2a21a3427cfedadb68412a7c3a8fc0f36af7977d\spring-data-commons-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.9\89818f4cc656107709d3db6b238ed9b776d3dbb4\spring-tx-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.9\745619eee32c8ead88a21c97748d2416f1db8dd9\spring-beans-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.7\41eb7184ea9d556f23e18b5cb99cad1f8581fc00\slf4j-api-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.7\fbc10086bb6d89e1e1d345ba4dbdd4917bc52362\spring-boot-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.7\7e31cd733c6469feaefb32a5dd473e096967eb16\spring-boot-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.7\df7589cb2aa1aa85383c8cb213ab02a87eb6ad4\spring-boot-starter-logging-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\3.0.2\92b6631659ba35ca09e44874d3eb936edfeee532\jakarta.validation-api-3.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf\3.1.1.RELEASE\374a129dfa5e7d7f1a46eacc4d49e594ca0cf26f\thymeleaf-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.3\35f7f751c3555dadccb6f173f9ac1e035a648da3\jackson-datatype-jsr310-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.3\fa8f81ea27d89cf73539bbc72c6304a30bcab631\jackson-module-parameter-names-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.3\9474ab543a65867461f8326c8fa0494b3efc761\jackson-datatype-jdk8-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.3\ba0373b04bf0f03b0cd268cd2e5e8444aaaf9208\jackson-databind-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.8\7abb8ab966dd135924c8e69cb2f1db735dee5f23\tomcat-embed-websocket-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.8\ec4b884806c65c80c86bb3db134f6f6f99e79ed8\tomcat-embed-core-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.9\f50a1df7ed038ee7ca85528aff652cef4ff4883b\spring-expression-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.7\69f51c7bdcf90e45d3f2dfa957b35dfe892b7466\micrometer-observation-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\json-smart\2.4.11\cc5888f14a5768f254b97bafe8b9fd29b31e872e\json-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.2\640c0d5aff45dbff1e1a1bc09673ff3a02b1ba12\jakarta.activation-api-2.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.23\d470526e8c4566c04e9ae5d3ccb62d1a7aa58986\byte-buddy-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-params\5.9.3\9e2a4bf6016a1975f408a73523392875cff7c26f\junit-jupiter-params-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-api\5.9.3\815818ad6ffcc8d320d8fbdf3d748c753cf83201\junit-jupiter-api-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy-agent\1.12.23\1cba11fdb72c383edacb909f79ae6870efd275e4\byte-buddy-agent-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.vaadin.external.google\android-json\0.0.20131108.vaadin1\fa26d351fe62a6a17f5cda1287c1c6110dec413f\android-json-0.0.20131108.vaadin1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.9\88d9ddfc6bbbf4047c2a8de8de94a425b06f636a\spring-jcl-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.7\307944865579a6d490e6a4cbb5082dc8f36536ca\logback-classic-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.7\a48f44aeaa8a5ddc347007298a28173ac1fbbd8b\jul-to-slf4j-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.attoparser\attoparser\2.0.6.RELEASE\8f603f22a18d4f7258f8860ccbb68b069f49904a\attoparser-2.0.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.unbescape\unbescape\1.1.6.RELEASE\7b90360afb2b860e09e8347112800d12c12b2a13\unbescape-1.1.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.3\b49701acb02b8e95ae1967821cfbafc220cf5795\jackson-annotations-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.3\4fa101f81504ed6811bf1823270adb51a9b45ff3\jackson-core-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.7\9c90b47bd3ef6758301f1882506acc332fa27329\micrometer-commons-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\accessors-smart\2.4.11\245ceca7bdf3190fbb977045c852d5f3c8efece1\accessors-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apiguardian\apiguardian-api\1.1.2\a231e0d844d2721b0fa1b238006d15c6ded6842a\apiguardian-api-1.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-commons\1.9.3\36b2e26a90c41603be7f0094bee80e3f8a2cd4d4\junit-platform-commons-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.opentest4j\opentest4j\1.2.0\28c11eb91f9b6d8e200631d46e20a7f407f2a046\opentest4j-1.2.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.7\a2948dae4013d0e9486141b4d638d8951becb767\logback-core-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\9.3\8e6300ef51c1d801a7ed62d07cd221aca3a90640\asm-9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.h2database\h2\2.1.214\d5c2005c9e3279201e12d4776c948578b16bf8b2\h2-2.1.214.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.2\e4e4e0c5b0d42054d00dc4023901572a60d368c7\jaxb-runtime-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.6.Final\77a5f94b56d49508e0ee334751db5b78e5ccd50c\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-engine\5.9.3\355322b03bf39306a183162cd06626c206f0286b\junit-jupiter-engine-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.objenesis\objenesis\3.2\7fadf57620c8b8abdf7519533e5527367cb51f09\objenesis-3.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.2\8c29249f6c10f4ee08967783831580b0f5c5360\jaxb-core-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-engine\1.9.3\8616734a190f8d307376aeb7353dba0a2c037a09\junit-platform-engine-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.0\72369f4e2314d38de2dcbb277141ef0226f73151\angus-activation-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.2\24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc\txw2-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 domain.UserServiceTest

java.lang.NullPointerException: Cannot invoke "domain.UserService.join(domain.User)" because "this.userService" is null

	at domain.UserServiceTest.회원가입(UserServiceTest.java:31)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)


Process finished with exit code -1

build.gradle

plugins {
	id 'java'
	id 'org.springframework.boot' version '3.0.7'
	id 'io.spring.dependency-management' version '1.1.0'
}

group = 'gaefourdong'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-validation' //유효성 검증
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' //web view
	implementation 'org.springframework.boot:spring-boot-starter-web'
	testImplementation 'junit:junit:4.13.1'
	compileOnly 'org.projectlombok:lombok'
//	runtimeOnly 'com.mysql:mysql-connector-j'
	runtimeOnly 'com.h2database:h2'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
//	testImplementation 'org.springframework.security:spring-security-test'

}

test {
	useJUnitPlatform()
}


bootJar{
	archivesBaseName = 'fitplace'
	archiveFileName = 'fitplace-server.jar'
	archiveVersion = "0.0.1"
}

UserServiceTest

package domain;

import org.junit.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

import static org.junit.Assert.assertEquals;


//메모리 모드 DB 연계 테스트
//@RunWith(SpringRunner.class) //junit 4
//@ExtendWith(SpringExtension.class) //junit 5
@SpringBootTest
@Transactional //rollback
public class UserServiceTest {
    @Autowired UserService userService;
    @Autowired UserRepository userRepository;

    @Test
    public void 회원가입() throws Exception {
        //Given
        User user = new User();
        user.setEmail("fitplace@naver.com"); //email 로 검증 -> name은 중복 존재 가능성 o

        //When
        String saveEmail = userService.join(user);

        //Then
        assertEquals(user, userRepository.findOne(saveEmail));
    }

//    @Test(expected = IllegalStateException.class)
//    public void 중복_회원_제외() throws Exception {
//        //Given
//
//        //When
//
//        //Then
//
//    }
//

}

 

testImplementation 'junit:junit:4.13.1'

번거로우시겠지만, 위의 의존성도 제거해주시고 한 번만 더 테스트해주시겠습니까?

 

jda0526님의 프로필 이미지
jda0526
질문자

제거 후 UserServiceTest 의 원문에서 image다음과 같이나오고 alt+tab 시

image이렇게 나옵니다

상단에 import 또한 적용되지않은상태로 나타납니다

image

UserserviceTest

package domain;

import org.junit.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

import static org.junit.Assert.assertEquals;


//메모리 모드 DB 연계 테스트
//@RunWith(SpringRunner.class) //junit 4
//@ExtendWith(SpringExtension.class) //junit 5
@SpringBootTest
@Transactional //rollback
public class UserServiceTest {
    @Autowired UserService userService;
    @Autowired UserRepository userRepository;

    @Test
    public void 회원가입() throws Exception {
        //Given
        User user = new User();
        user.setEmail("fitplace@naver.com"); //email 로 검증 -> name은 중복 존재 가능성 o

        //When
        String saveEmail = userService.join(user);

        //Then
        assertEquals(user, userRepository.findOne(saveEmail));
    }

//    @Test(expected = IllegalStateException.class)
//    public void 중복_회원_제외() throws Exception {
//        //Given
//
//        //When
//
//        //Then
//
//    }
//

}

위에 빨간 줄 뜨는 import를 다 지워주시고

다시 임포트하려고 하면 junit5의 것으로 임포트 되지 않으십니까?

jda0526님의 프로필 이미지
jda0526
질문자

말씀해주신것처럼 변경 후 임포트하고 run 시

image다음과 같은 에러가 뜹니다 ㅠㅠ

error문구

"C:\Program Files\Java\jdk-17\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar=57417:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-launcher\1.9.3\junit-platform-launcher-1.9.3.jar;C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-engine\1.9.3\junit-platform-engine-1.9.3.jar;C:\Users\duath\.m2\repository\org\opentest4j\opentest4j\1.2.0\opentest4j-1.2.0.jar;C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-commons\1.9.3\junit-platform-commons-1.9.3.jar;C:\Users\duath\.m2\repository\org\apiguardian\apiguardian-api\1.1.2\apiguardian-api-1.1.2.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit-rt.jar;C:\Users\duath\FitPlace_BE\server\out\test\classes;C:\Users\duath\FitPlace_BE\server\out\production\classes;C:\Users\duath\FitPlace_BE\server\out\production\resources;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.7\29ed7c24fd710adb11c216840860045946b7fa3e\spring-boot-starter-data-jpa-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\3.0.7\7433d4400479c9190aa59bf399357c9c749d20c8\spring-boot-starter-validation-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-thymeleaf\3.0.7\cdf465d29c9549bc7c215e890717bbbf64510bf1\spring-boot-starter-thymeleaf-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.7\6fd83cc63305158f43e1ccb5d218cb64a5a07306\spring-boot-starter-web-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-test\3.0.7\8c3767d0dc2e5c634fcea7c88ffb2f0b15d7d161\spring-boot-starter-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.7\8ed272d1ea64fd34b25e272426a61c1381251679\spring-boot-starter-aop-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.7\bf69e667f79b929b41c5bf1d3921befea6f5c83d\spring-boot-starter-jdbc-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.7.Final\343f47b34c96fe9c44bf9b219a7b3c5d6d2fc90e\hibernate-core-6.1.7.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.6\8cb5c5f4fbeec3291051eccec948142ed57e4de2\spring-data-jpa-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.9\3b06099725350189816fcfad01834450378500ca\spring-aspects-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.7\5fe8a6a2e71bbfce6ab717214bb8b7d0e726ccda\spring-boot-starter-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.8\6f3a4ae2ae37270eeb6e9bec4e7207facdc9e8fa\tomcat-embed-el-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\8.0.0.Final\8e0389f22a3a246915a3311877da4168256b95d2\hibernate-validator-8.0.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf-spring6\3.1.1.RELEASE\deb52ef921a4ac5132fedb7ebfc2bc1dad4382b3\thymeleaf-spring6-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.7\31f75f791f960d75e4792124ddf6e67763ebb4a8\spring-boot-starter-json-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.7\b2c4286c147c72cb3885981911128dd79ebb59c2\spring-boot-starter-tomcat-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.9\e127c07a23403832d0c6292f4a0bf8c7a2b7329f\spring-webmvc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.9\2837dec8a75ecfdad367d6c30ce9cbdfc89caa7a\spring-web-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test-autoconfigure\3.0.7\511b8a00015bfccaf926e1500e7c927416cdd1b2\spring-boot-test-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test\3.0.7\33f86c8c1002f6de27414a55a2a6f484cc117a2b\spring-boot-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.jayway.jsonpath\json-path\2.7.0\f9d7d9659f2694e61142046ff8a216c047f263e8\json-path-2.7.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.assertj\assertj-core\3.23.1\d2bb60570f5b3d7ffa8f8000118c9c07b86eca93\assertj-core-3.23.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter\5.9.3\72e840501e1550e9799c9a5cc9483d7d6b29e0ba\junit-jupiter-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-junit-jupiter\4.8.1\e393aa62eca2244a535b03842843f2f199343d1f\mockito-junit-jupiter-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-core\4.8.1\d8eb9dec8747d08645347bb8c69088ac83197975\mockito-core-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.skyscreamer\jsonassert\1.5.1\6d842d0faf4cf6725c509a5e5347d319ee0431c3\jsonassert-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-test\6.0.9\f50dd9d3b153dd2f56fa760f1cf8247f56f1ad45\spring-test-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.9\284ed111fa0b49b29f6fea6ac0afa402b809e427\spring-core-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.xmlunit\xmlunit-core\2.9.1\e5833662d9a1279a37da3ef6f62a1da29fcd68c4\xmlunit-core-2.9.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.9\8c1025bf9c1dc66f5268639866b5a45ed9bc62ef\spring-aop-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.9\814fe718b4d17187081c8efa66aaad7754d4675b\spring-jdbc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.9\be88c57829b9ec038774b47c241ac45673352a55\spring-context-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.9\b211685d9f7499402b74f02a5b32447032095ac6\spring-orm-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.6\2a21a3427cfedadb68412a7c3a8fc0f36af7977d\spring-data-commons-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.9\89818f4cc656107709d3db6b238ed9b776d3dbb4\spring-tx-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.9\745619eee32c8ead88a21c97748d2416f1db8dd9\spring-beans-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.7\41eb7184ea9d556f23e18b5cb99cad1f8581fc00\slf4j-api-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.7\fbc10086bb6d89e1e1d345ba4dbdd4917bc52362\spring-boot-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.7\7e31cd733c6469feaefb32a5dd473e096967eb16\spring-boot-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.7\df7589cb2aa1aa85383c8cb213ab02a87eb6ad4\spring-boot-starter-logging-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\3.0.2\92b6631659ba35ca09e44874d3eb936edfeee532\jakarta.validation-api-3.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf\3.1.1.RELEASE\374a129dfa5e7d7f1a46eacc4d49e594ca0cf26f\thymeleaf-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.3\35f7f751c3555dadccb6f173f9ac1e035a648da3\jackson-datatype-jsr310-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.3\fa8f81ea27d89cf73539bbc72c6304a30bcab631\jackson-module-parameter-names-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.3\9474ab543a65867461f8326c8fa0494b3efc761\jackson-datatype-jdk8-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.3\ba0373b04bf0f03b0cd268cd2e5e8444aaaf9208\jackson-databind-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.8\7abb8ab966dd135924c8e69cb2f1db735dee5f23\tomcat-embed-websocket-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.8\ec4b884806c65c80c86bb3db134f6f6f99e79ed8\tomcat-embed-core-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.9\f50a1df7ed038ee7ca85528aff652cef4ff4883b\spring-expression-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.7\69f51c7bdcf90e45d3f2dfa957b35dfe892b7466\micrometer-observation-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\json-smart\2.4.11\cc5888f14a5768f254b97bafe8b9fd29b31e872e\json-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.2\640c0d5aff45dbff1e1a1bc09673ff3a02b1ba12\jakarta.activation-api-2.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.23\d470526e8c4566c04e9ae5d3ccb62d1a7aa58986\byte-buddy-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-params\5.9.3\9e2a4bf6016a1975f408a73523392875cff7c26f\junit-jupiter-params-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-api\5.9.3\815818ad6ffcc8d320d8fbdf3d748c753cf83201\junit-jupiter-api-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy-agent\1.12.23\1cba11fdb72c383edacb909f79ae6870efd275e4\byte-buddy-agent-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.vaadin.external.google\android-json\0.0.20131108.vaadin1\fa26d351fe62a6a17f5cda1287c1c6110dec413f\android-json-0.0.20131108.vaadin1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.9\88d9ddfc6bbbf4047c2a8de8de94a425b06f636a\spring-jcl-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.7\307944865579a6d490e6a4cbb5082dc8f36536ca\logback-classic-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.7\a48f44aeaa8a5ddc347007298a28173ac1fbbd8b\jul-to-slf4j-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.attoparser\attoparser\2.0.6.RELEASE\8f603f22a18d4f7258f8860ccbb68b069f49904a\attoparser-2.0.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.unbescape\unbescape\1.1.6.RELEASE\7b90360afb2b860e09e8347112800d12c12b2a13\unbescape-1.1.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.3\b49701acb02b8e95ae1967821cfbafc220cf5795\jackson-annotations-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.3\4fa101f81504ed6811bf1823270adb51a9b45ff3\jackson-core-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.7\9c90b47bd3ef6758301f1882506acc332fa27329\micrometer-commons-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\accessors-smart\2.4.11\245ceca7bdf3190fbb977045c852d5f3c8efece1\accessors-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apiguardian\apiguardian-api\1.1.2\a231e0d844d2721b0fa1b238006d15c6ded6842a\apiguardian-api-1.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-commons\1.9.3\36b2e26a90c41603be7f0094bee80e3f8a2cd4d4\junit-platform-commons-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.opentest4j\opentest4j\1.2.0\28c11eb91f9b6d8e200631d46e20a7f407f2a046\opentest4j-1.2.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.7\a2948dae4013d0e9486141b4d638d8951becb767\logback-core-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\9.3\8e6300ef51c1d801a7ed62d07cd221aca3a90640\asm-9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.h2database\h2\2.1.214\d5c2005c9e3279201e12d4776c948578b16bf8b2\h2-2.1.214.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.2\e4e4e0c5b0d42054d00dc4023901572a60d368c7\jaxb-runtime-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.6.Final\77a5f94b56d49508e0ee334751db5b78e5ccd50c\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-engine\5.9.3\355322b03bf39306a183162cd06626c206f0286b\junit-jupiter-engine-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.objenesis\objenesis\3.2\7fadf57620c8b8abdf7519533e5527367cb51f09\objenesis-3.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.2\8c29249f6c10f4ee08967783831580b0f5c5360\jaxb-core-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-engine\1.9.3\8616734a190f8d307376aeb7353dba0a2c037a09\junit-platform-engine-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.0\72369f4e2314d38de2dcbb277141ef0226f73151\angus-activation-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.2\24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc\txw2-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 domain.UserServiceTest
14:41:13.262 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Neither @ContextConfiguration nor @ContextHierarchy found for test class [UserServiceTest]: using SpringBootContextLoader
14:41:13.265 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader -- Could not detect default resource locations for test class [domain.UserServiceTest]: no resource found for suffixes {-context.xml, Context.groovy}.
14:41:13.265 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [domain.UserServiceTest]: UserServiceTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
14:41:13.288 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Using ContextCustomizers for test class [UserServiceTest]: [DisableObservabilityContextCustomizer, PropertyMappingContextCustomizer, Customizer, ExcludeFilterContextCustomizer, DuplicateJsonObjectContextCustomizer, MockitoContextCustomizer, TestRestTemplateContextCustomizer]

Test ignored.

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

	at org.springframework.util.Assert.state(Assert.java:76)
	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.findConfigurationClass(SpringBootTestContextBootstrapper.java:260)
	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:247)
	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:164)
	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:375)
	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildDefaultMergedContextConfiguration(AbstractTestContextBootstrapper.java:291)
	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:239)
	at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:107)
	at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:113)
	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:129)
	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:113)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$4(ExtensionValuesStore.java:86)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.computeValue(ExtensionValuesStore.java:223)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:211)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore$StoredValue.evaluate(ExtensionValuesStore.java:191)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore$StoredValue.access$100(ExtensionValuesStore.java:171)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:89)
	at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:93)
	at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:61)
	at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:294)
	at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:113)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$12(ClassBasedTestDescriptor.java:395)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:395)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:211)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:84)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:148)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)


Process finished with exit code -1

UserServiceTest

package domain;


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

import static org.junit.jupiter.api.Assertions.assertEquals;


//메모리 모드 DB 연계 테스트
//@RunWith(SpringRunner.class) //junit 4
//@ExtendWith(SpringExtension.class) //junit 5
@SpringBootTest
@Transactional //rollback
public class UserServiceTest {
    @Autowired UserService userService;
    @Autowired UserRepository userRepository;

    @Test
    public void 회원가입() throws Exception {
        //Given
        User user = new User();
        user.setEmail("fitplace@naver.com"); //email 로 검증 -> name은 중복 존재 가능성 o

        //When
        String saveEmail = userService.join(user);

        //Then
        assertEquals(user, userRepository.findOne(saveEmail));
    }

//    @Test(expected = IllegalStateException.class)
//    public void 중복_회원_제외() throws Exception {
//        //Given
//
//        //When
//
//        //Then
//
//    }
//

}

프로젝트 코드를 한 번 보고 싶습니다!

실제 동작하는 전체 프로젝트를 압축해서 구글 드라이브로 공유해서 링크를 남겨주세요.

구글 드라이브 업로드 방법은 다음을 참고해주세요.

https://bit.ly/3fX6ygx


주의: 업로드시 링크에 있는 권한 문제 꼭 확인해주세요


추가로 다음 내용도 코멘트 부탁드립니다.

1. 문제 영역을 실행할 수 있는 방법

2. 문제가 어떻게 나타나는지에 대한 상세한 설명

감사합니다.

jda0526님의 프로필 이미지
jda0526
질문자

https://drive.google.com/file/d/1ZwGwfeYmTfvjbQuhUaGXc-lSr6-mB_Uy/view?usp=sharing

구글드라이브에 zip 파일로 올려놨습니당.

1. 문제 영역을 실행할 수 있는 방법

->test.UserServieceTest 에서 실행하면 됩니다.

2. 문제가 어떻게 나타나는지에 대한 상세한 설명

-> UserServiceTest의 회원가입에서 오류가 발생합니다.

주로

1. domain.UserServiec의 join에서 인식을하지 못하거나

  1. Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test 같은 에러가 나는데 같은 계층에 있음에도 불구하고 나타납니다

    2번같은경우 다음블로그를 참고하여 UserServiece를 클래스로 지정해도 비슷하게 UserRepository를 인식하지 못한다고 나타납니다

    -> 참고블로그 : https://unhosted.tistory.com/77

image

"C:\Program Files\Java\jdk-17\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar=57925:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-launcher\1.9.3\junit-platform-launcher-1.9.3.jar;C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-engine\1.9.3\junit-platform-engine-1.9.3.jar;C:\Users\duath\.m2\repository\org\opentest4j\opentest4j\1.2.0\opentest4j-1.2.0.jar;C:\Users\duath\.m2\repository\org\junit\platform\junit-platform-commons\1.9.3\junit-platform-commons-1.9.3.jar;C:\Users\duath\.m2\repository\org\apiguardian\apiguardian-api\1.1.2\apiguardian-api-1.1.2.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1\plugins\junit\lib\junit-rt.jar;C:\Users\duath\FitPlace_BE\server\out\test\classes;C:\Users\duath\FitPlace_BE\server\out\production\classes;C:\Users\duath\FitPlace_BE\server\out\production\resources;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.7\29ed7c24fd710adb11c216840860045946b7fa3e\spring-boot-starter-data-jpa-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\3.0.7\7433d4400479c9190aa59bf399357c9c749d20c8\spring-boot-starter-validation-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-thymeleaf\3.0.7\cdf465d29c9549bc7c215e890717bbbf64510bf1\spring-boot-starter-thymeleaf-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.7\6fd83cc63305158f43e1ccb5d218cb64a5a07306\spring-boot-starter-web-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-test\3.0.7\8c3767d0dc2e5c634fcea7c88ffb2f0b15d7d161\spring-boot-starter-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.7\8ed272d1ea64fd34b25e272426a61c1381251679\spring-boot-starter-aop-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.7\bf69e667f79b929b41c5bf1d3921befea6f5c83d\spring-boot-starter-jdbc-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.7.Final\343f47b34c96fe9c44bf9b219a7b3c5d6d2fc90e\hibernate-core-6.1.7.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.6\8cb5c5f4fbeec3291051eccec948142ed57e4de2\spring-data-jpa-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.9\3b06099725350189816fcfad01834450378500ca\spring-aspects-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.7\5fe8a6a2e71bbfce6ab717214bb8b7d0e726ccda\spring-boot-starter-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.8\6f3a4ae2ae37270eeb6e9bec4e7207facdc9e8fa\tomcat-embed-el-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\8.0.0.Final\8e0389f22a3a246915a3311877da4168256b95d2\hibernate-validator-8.0.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf-spring6\3.1.1.RELEASE\deb52ef921a4ac5132fedb7ebfc2bc1dad4382b3\thymeleaf-spring6-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.7\31f75f791f960d75e4792124ddf6e67763ebb4a8\spring-boot-starter-json-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.7\b2c4286c147c72cb3885981911128dd79ebb59c2\spring-boot-starter-tomcat-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.9\e127c07a23403832d0c6292f4a0bf8c7a2b7329f\spring-webmvc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.9\2837dec8a75ecfdad367d6c30ce9cbdfc89caa7a\spring-web-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test-autoconfigure\3.0.7\511b8a00015bfccaf926e1500e7c927416cdd1b2\spring-boot-test-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test\3.0.7\33f86c8c1002f6de27414a55a2a6f484cc117a2b\spring-boot-test-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.jayway.jsonpath\json-path\2.7.0\f9d7d9659f2694e61142046ff8a216c047f263e8\json-path-2.7.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.assertj\assertj-core\3.23.1\d2bb60570f5b3d7ffa8f8000118c9c07b86eca93\assertj-core-3.23.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter\5.9.3\72e840501e1550e9799c9a5cc9483d7d6b29e0ba\junit-jupiter-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-junit-jupiter\4.8.1\e393aa62eca2244a535b03842843f2f199343d1f\mockito-junit-jupiter-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-core\4.8.1\d8eb9dec8747d08645347bb8c69088ac83197975\mockito-core-4.8.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.skyscreamer\jsonassert\1.5.1\6d842d0faf4cf6725c509a5e5347d319ee0431c3\jsonassert-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-test\6.0.9\f50dd9d3b153dd2f56fa760f1cf8247f56f1ad45\spring-test-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.9\284ed111fa0b49b29f6fea6ac0afa402b809e427\spring-core-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.xmlunit\xmlunit-core\2.9.1\e5833662d9a1279a37da3ef6f62a1da29fcd68c4\xmlunit-core-2.9.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.9\8c1025bf9c1dc66f5268639866b5a45ed9bc62ef\spring-aop-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.9\814fe718b4d17187081c8efa66aaad7754d4675b\spring-jdbc-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.9\be88c57829b9ec038774b47c241ac45673352a55\spring-context-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.9\b211685d9f7499402b74f02a5b32447032095ac6\spring-orm-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.6\2a21a3427cfedadb68412a7c3a8fc0f36af7977d\spring-data-commons-3.0.6.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.9\89818f4cc656107709d3db6b238ed9b776d3dbb4\spring-tx-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.9\745619eee32c8ead88a21c97748d2416f1db8dd9\spring-beans-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.7\41eb7184ea9d556f23e18b5cb99cad1f8581fc00\slf4j-api-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.7\fbc10086bb6d89e1e1d345ba4dbdd4917bc52362\spring-boot-autoconfigure-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.7\7e31cd733c6469feaefb32a5dd473e096967eb16\spring-boot-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.7\df7589cb2aa1aa85383c8cb213ab02a87eb6ad4\spring-boot-starter-logging-3.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\3.0.2\92b6631659ba35ca09e44874d3eb936edfeee532\jakarta.validation-api-3.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf\3.1.1.RELEASE\374a129dfa5e7d7f1a46eacc4d49e594ca0cf26f\thymeleaf-3.1.1.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.3\35f7f751c3555dadccb6f173f9ac1e035a648da3\jackson-datatype-jsr310-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.3\fa8f81ea27d89cf73539bbc72c6304a30bcab631\jackson-module-parameter-names-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.3\9474ab543a65867461f8326c8fa0494b3efc761\jackson-datatype-jdk8-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.3\ba0373b04bf0f03b0cd268cd2e5e8444aaaf9208\jackson-databind-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.8\7abb8ab966dd135924c8e69cb2f1db735dee5f23\tomcat-embed-websocket-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.8\ec4b884806c65c80c86bb3db134f6f6f99e79ed8\tomcat-embed-core-10.1.8.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.9\f50a1df7ed038ee7ca85528aff652cef4ff4883b\spring-expression-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.7\69f51c7bdcf90e45d3f2dfa957b35dfe892b7466\micrometer-observation-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\json-smart\2.4.11\cc5888f14a5768f254b97bafe8b9fd29b31e872e\json-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.2\640c0d5aff45dbff1e1a1bc09673ff3a02b1ba12\jakarta.activation-api-2.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.23\d470526e8c4566c04e9ae5d3ccb62d1a7aa58986\byte-buddy-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-params\5.9.3\9e2a4bf6016a1975f408a73523392875cff7c26f\junit-jupiter-params-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-api\5.9.3\815818ad6ffcc8d320d8fbdf3d748c753cf83201\junit-jupiter-api-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy-agent\1.12.23\1cba11fdb72c383edacb909f79ae6870efd275e4\byte-buddy-agent-1.12.23.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.vaadin.external.google\android-json\0.0.20131108.vaadin1\fa26d351fe62a6a17f5cda1287c1c6110dec413f\android-json-0.0.20131108.vaadin1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.9\88d9ddfc6bbbf4047c2a8de8de94a425b06f636a\spring-jcl-6.0.9.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.7\307944865579a6d490e6a4cbb5082dc8f36536ca\logback-classic-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.7\a48f44aeaa8a5ddc347007298a28173ac1fbbd8b\jul-to-slf4j-2.0.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.attoparser\attoparser\2.0.6.RELEASE\8f603f22a18d4f7258f8860ccbb68b069f49904a\attoparser-2.0.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.unbescape\unbescape\1.1.6.RELEASE\7b90360afb2b860e09e8347112800d12c12b2a13\unbescape-1.1.6.RELEASE.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.3\b49701acb02b8e95ae1967821cfbafc220cf5795\jackson-annotations-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.3\4fa101f81504ed6811bf1823270adb51a9b45ff3\jackson-core-2.14.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.7\9c90b47bd3ef6758301f1882506acc332fa27329\micrometer-commons-1.10.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\net.minidev\accessors-smart\2.4.11\245ceca7bdf3190fbb977045c852d5f3c8efece1\accessors-smart-2.4.11.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apiguardian\apiguardian-api\1.1.2\a231e0d844d2721b0fa1b238006d15c6ded6842a\apiguardian-api-1.1.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-commons\1.9.3\36b2e26a90c41603be7f0094bee80e3f8a2cd4d4\junit-platform-commons-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.opentest4j\opentest4j\1.2.0\28c11eb91f9b6d8e200631d46e20a7f407f2a046\opentest4j-1.2.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.7\a2948dae4013d0e9486141b4d638d8951becb767\logback-core-1.4.7.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\9.3\8e6300ef51c1d801a7ed62d07cd221aca3a90640\asm-9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.h2database\h2\2.1.214\d5c2005c9e3279201e12d4776c948578b16bf8b2\h2-2.1.214.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.2\e4e4e0c5b0d42054d00dc4023901572a60d368c7\jaxb-runtime-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.6.Final\77a5f94b56d49508e0ee334751db5b78e5ccd50c\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-engine\5.9.3\355322b03bf39306a183162cd06626c206f0286b\junit-jupiter-engine-5.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.objenesis\objenesis\3.2\7fadf57620c8b8abdf7519533e5527367cb51f09\objenesis-3.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.2\8c29249f6c10f4ee08967783831580b0f5c5360\jaxb-core-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-engine\1.9.3\8616734a190f8d307376aeb7353dba0a2c037a09\junit-platform-engine-1.9.3.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.0\72369f4e2314d38de2dcbb277141ef0226f73151\angus-activation-2.0.0.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.2\24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc\txw2-4.0.2.jar;C:\Users\duath\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 domain.UserServiceTest
15:14:00.721 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Neither @ContextConfiguration nor @ContextHierarchy found for test class [UserServiceTest]: using SpringBootContextLoader
15:14:00.724 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader -- Could not detect default resource locations for test class [domain.UserServiceTest]: no resource found for suffixes {-context.xml, Context.groovy}.
15:14:00.745 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Using ContextCustomizers for test class [UserServiceTest]: [DisableObservabilityContextCustomizer, PropertyMappingContextCustomizer, Customizer, ExcludeFilterContextCustomizer, DuplicateJsonObjectContextCustomizer, MockitoContextCustomizer, TestRestTemplateContextCustomizer]
15:14:00.865 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Using TestExecutionListeners for test class [UserServiceTest]: [ServletTestExecutionListener, DirtiesContextBeforeModesTestExecutionListener, ApplicationEventsTestExecutionListener, MockitoTestExecutionListener, DependencyInjectionTestExecutionListener, DirtiesContextTestExecutionListener, TransactionalTestExecutionListener, SqlScriptsTestExecutionListener, EventPublishingTestExecutionListener, RestDocsTestExecutionListener, MockRestServiceServerResetTestExecutionListener, MockMvcPrintOnlyOnFailureTestExecutionListener, WebDriverTestExecutionListener, MockWebServiceServerTestExecutionListener, ResetMocksTestExecutionListener]
15:14:00.867 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener -- Before test class: class [UserServiceTest], class annotated with @DirtiesContext [false] with mode [null]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.0.7)

2023-07-10T15:14:01.206+09:00  INFO 25796 --- [           main] domain.UserServiceTest                   : Starting UserServiceTest using Java 17.0.7 with PID 25796 (started by duath in C:\Users\duath\FitPlace_BE\server)
2023-07-10T15:14:01.207+09:00  INFO 25796 --- [           main] domain.UserServiceTest                   : The following 1 profile is active: "-secret"
2023-07-10T15:14:01.325+09:00  WARN 25796 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2023-07-10T15:14:01.599+09:00 ERROR 25796 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in domain.UserService required a bean of type 'domain.UserRepository' that could not be found.


Action:

Consider defining a bean of type 'domain.UserRepository' in your configuration.




============================
CONDITIONS EVALUATION REPORT
============================


Positive matches:
-----------------

    None


Negative matches:
-----------------

    None


Exclusions:
-----------

    None


Unconditional classes:
----------------------

    None



2023-07-10T15:14:01.603+09:00 ERROR 25796 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] to prepare test instance [domain.UserServiceTest@4d6f623d]

java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@1e6b9a95 testClass = domain.UserServiceTest, locations = [], classes = [domain.UserService], contextInitializerClasses = [], activeProfiles = [], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@741a8937, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@bae7dc0, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2ed2d9cb, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@6404f418, org.springframework.boot.test.context.SpringBootTestAnnotation@95222fa8], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:142) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:191) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:130) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) ~[spring-test-6.0.9.jar:6.0.9]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) ~[na:na]
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) ~[na:na]
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[na:na]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at java.base/java.util.Optional.orElseGet(Optional.java:364) ~[na:na]
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68) ~[junit-jupiter-engine-5.9.3.jar:5.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) ~[junit-platform-engine-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) ~[junit-platform-launcher-1.9.3.jar:1.9.3]
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57) ~[junit5-rt.jar:na]
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) ~[junit-rt.jar:na]
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) ~[idea_rt.jar:na]
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) ~[junit-rt.jar:na]
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) ~[junit-rt.jar:na]
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) ~[junit-rt.jar:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:245) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1189) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:941) ~[spring-context-6.0.9.jar:6.0.9]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.9.jar:6.0.9]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.7.jar:3.0.7]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.7.jar:3.0.7]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.7.jar:3.0.7]
	at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137) ~[spring-boot-test-3.0.7.jar:3.0.7]
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[spring-core-6.0.9.jar:6.0.9]
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[spring-core-6.0.9.jar:6.0.9]
	at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1388) ~[spring-boot-3.0.7.jar:3.0.7]
	at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:545) ~[spring-boot-test-3.0.7.jar:3.0.7]
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137) ~[spring-boot-test-3.0.7.jar:3.0.7]
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108) ~[spring-boot-test-3.0.7.jar:3.0.7]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:184) ~[spring-test-6.0.9.jar:6.0.9]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:118) ~[spring-test-6.0.9.jar:6.0.9]
	... 72 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:888) ~[spring-beans-6.0.9.jar:6.0.9]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-6.0.9.jar:6.0.9]
	... 96 common frames omitted


java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@1e6b9a95 testClass = domain.UserServiceTest, locations = [], classes = [domain.UserService], contextInitializerClasses = [], activeProfiles = [], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@741a8937, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@bae7dc0, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2ed2d9cb, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@6404f418, org.springframework.boot.test.context.SpringBootTestAnnotation@95222fa8], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]

	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:142)
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127)
	at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:191)
	at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:130)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241)
	at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277)
	at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:245)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1352)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1189)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:941)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
	at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
	at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
	at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1388)
	at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:545)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137)
	at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:184)
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:118)
	... 72 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'domain.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:888)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
	... 96 more


Process finished with exit code -1
jda0526님의 프로필 이미지
jda0526

작성한 질문수

질문하기