From b2476795224a322688397e906567a7a9cc044d75 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 06:41:46 +0000 Subject: [PATCH 1/4] Initial plan From e85ab3a63f31100bf14e653a2d278886c2a5b2e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:01:05 +0000 Subject: [PATCH 2/4] Complete REST API implementation with JWT authentication Co-authored-by: yus04 <49590084+yus04@users.noreply.github.com> --- pom.xml | 93 + .../example/userapi/UserApiApplication.java | 11 + .../example/userapi/config/DataLoader.java | 26 + .../userapi/controller/UserController.java | 34 + .../com/example/userapi/dto/UserResponse.java | 51 + .../java/com/example/userapi/entity/User.java | 69 + .../exception/GlobalExceptionHandler.java | 49 + .../exception/UserNotFoundException.java | 7 + .../userapi/repository/UserRepository.java | 9 + .../security/JwtAuthenticationFilter.java | 49 + .../com/example/userapi/security/JwtUtil.java | 68 + .../userapi/security/SecurityConfig.java | 39 + .../example/userapi/util/TokenGenerator.java | 27 + src/main/resources/application.properties | 29 + .../userapi/UserApiApplicationTest.java | 15 + .../controller/UserControllerTest.java | 114 ++ .../example/userapi/security/JwtUtilTest.java | 68 + .../resources/application-test.properties | 25 + target/classes/application.properties | 29 + .../example/userapi/UserApiApplication.class | Bin 0 -> 748 bytes .../example/userapi/config/DataLoader.class | Bin 0 -> 1308 bytes .../userapi/controller/UserController.class | Bin 0 -> 2944 bytes .../example/userapi/dto/UserResponse.class | Bin 0 -> 1468 bytes .../com/example/userapi/entity/User.class | Bin 0 -> 1976 bytes .../exception/GlobalExceptionHandler.class | Bin 0 -> 3468 bytes .../exception/UserNotFoundException.class | Bin 0 -> 941 bytes .../userapi/repository/UserRepository.class | Bin 0 -> 434 bytes .../security/JwtAuthenticationFilter.class | Bin 0 -> 3147 bytes .../example/userapi/security/JwtUtil.class | Bin 0 -> 3165 bytes .../userapi/security/SecurityConfig.class | Bin 0 -> 6484 bytes .../example/userapi/util/TokenGenerator.class | Bin 0 -> 1403 bytes .../compile/default-compile/createdFiles.lst | 12 + .../compile/default-compile/inputFiles.lst | 12 + .../default-testCompile/createdFiles.lst | 3 + .../default-testCompile/inputFiles.lst | 3 + ...example.userapi.UserApiApplicationTest.xml | 392 ++++ ....userapi.controller.UserControllerTest.xml | 1724 +++++++++++++++++ ...m.example.userapi.security.JwtUtilTest.xml | 1724 +++++++++++++++++ ...example.userapi.UserApiApplicationTest.txt | 116 ++ ....userapi.controller.UserControllerTest.txt | 564 ++++++ ...m.example.userapi.security.JwtUtilTest.txt | 564 ++++++ .../test-classes/application-test.properties | 22 + .../userapi/UserApiApplicationTest.class | Bin 0 -> 622 bytes .../controller/UserControllerTest.class | Bin 0 -> 6811 bytes .../userapi/security/JwtUtilTest.class | Bin 0 -> 2338 bytes 45 files changed, 5948 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/example/userapi/UserApiApplication.java create mode 100644 src/main/java/com/example/userapi/config/DataLoader.java create mode 100644 src/main/java/com/example/userapi/controller/UserController.java create mode 100644 src/main/java/com/example/userapi/dto/UserResponse.java create mode 100644 src/main/java/com/example/userapi/entity/User.java create mode 100644 src/main/java/com/example/userapi/exception/GlobalExceptionHandler.java create mode 100644 src/main/java/com/example/userapi/exception/UserNotFoundException.java create mode 100644 src/main/java/com/example/userapi/repository/UserRepository.java create mode 100644 src/main/java/com/example/userapi/security/JwtAuthenticationFilter.java create mode 100644 src/main/java/com/example/userapi/security/JwtUtil.java create mode 100644 src/main/java/com/example/userapi/security/SecurityConfig.java create mode 100644 src/main/java/com/example/userapi/util/TokenGenerator.java create mode 100644 src/main/resources/application.properties create mode 100644 src/test/java/com/example/userapi/UserApiApplicationTest.java create mode 100644 src/test/java/com/example/userapi/controller/UserControllerTest.java create mode 100644 src/test/java/com/example/userapi/security/JwtUtilTest.java create mode 100644 src/test/resources/application-test.properties create mode 100644 target/classes/application.properties create mode 100644 target/classes/com/example/userapi/UserApiApplication.class create mode 100644 target/classes/com/example/userapi/config/DataLoader.class create mode 100644 target/classes/com/example/userapi/controller/UserController.class create mode 100644 target/classes/com/example/userapi/dto/UserResponse.class create mode 100644 target/classes/com/example/userapi/entity/User.class create mode 100644 target/classes/com/example/userapi/exception/GlobalExceptionHandler.class create mode 100644 target/classes/com/example/userapi/exception/UserNotFoundException.class create mode 100644 target/classes/com/example/userapi/repository/UserRepository.class create mode 100644 target/classes/com/example/userapi/security/JwtAuthenticationFilter.class create mode 100644 target/classes/com/example/userapi/security/JwtUtil.class create mode 100644 target/classes/com/example/userapi/security/SecurityConfig.class create mode 100644 target/classes/com/example/userapi/util/TokenGenerator.class create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst create mode 100644 target/surefire-reports/TEST-com.example.userapi.UserApiApplicationTest.xml create mode 100644 target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml create mode 100644 target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml create mode 100644 target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt create mode 100644 target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt create mode 100644 target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt create mode 100644 target/test-classes/application-test.properties create mode 100644 target/test-classes/com/example/userapi/UserApiApplicationTest.class create mode 100644 target/test-classes/com/example/userapi/controller/UserControllerTest.class create mode 100644 target/test-classes/com/example/userapi/security/JwtUtilTest.class diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ba8696b --- /dev/null +++ b/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.1.5 + + + + com.example + user-api + 1.0.0 + jar + + User API + REST API for user management with JWT authentication + + + 17 + 0.11.5 + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-validation + + + + + io.jsonwebtoken + jjwt-api + ${jwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jwt.version} + runtime + + + io.jsonwebtoken + jjwt-jackson + ${jwt.version} + runtime + + + + + com.h2database + h2 + runtime + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/src/main/java/com/example/userapi/UserApiApplication.java b/src/main/java/com/example/userapi/UserApiApplication.java new file mode 100644 index 0000000..d11cecc --- /dev/null +++ b/src/main/java/com/example/userapi/UserApiApplication.java @@ -0,0 +1,11 @@ +package com.example.userapi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class UserApiApplication { + public static void main(String[] args) { + SpringApplication.run(UserApiApplication.class, args); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/config/DataLoader.java b/src/main/java/com/example/userapi/config/DataLoader.java new file mode 100644 index 0000000..e7ce084 --- /dev/null +++ b/src/main/java/com/example/userapi/config/DataLoader.java @@ -0,0 +1,26 @@ +package com.example.userapi.config; + +import com.example.userapi.entity.User; +import com.example.userapi.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Component; + +@Component +@Profile("!test") +public class DataLoader implements CommandLineRunner { + + @Autowired + private UserRepository userRepository; + + @Override + public void run(String... args) throws Exception { + // Only load data if the repository is empty + if (userRepository.count() == 0) { + userRepository.save(new User("Admin User", "admin@example.com", "ADMIN")); + userRepository.save(new User("Regular User", "user@example.com", "USER")); + userRepository.save(new User("Test User", "test@example.com", "USER")); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/controller/UserController.java b/src/main/java/com/example/userapi/controller/UserController.java new file mode 100644 index 0000000..6671ec6 --- /dev/null +++ b/src/main/java/com/example/userapi/controller/UserController.java @@ -0,0 +1,34 @@ +package com.example.userapi.controller; + +import com.example.userapi.dto.UserResponse; +import com.example.userapi.entity.User; +import com.example.userapi.exception.UserNotFoundException; +import com.example.userapi.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/users") +public class UserController { + + @Autowired + private UserRepository userRepository; + + @GetMapping("/{id}") + @PreAuthorize("hasRole('ADMIN')") + public ResponseEntity getUserById(@PathVariable Long id) { + User user = userRepository.findById(id) + .orElseThrow(() -> new UserNotFoundException(id)); + + UserResponse response = new UserResponse( + user.getId(), + user.getName(), + user.getEmail(), + user.getRole() + ); + + return ResponseEntity.ok(response); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/dto/UserResponse.java b/src/main/java/com/example/userapi/dto/UserResponse.java new file mode 100644 index 0000000..b0dc4b5 --- /dev/null +++ b/src/main/java/com/example/userapi/dto/UserResponse.java @@ -0,0 +1,51 @@ +package com.example.userapi.dto; + +public class UserResponse { + private Long id; + private String name; + private String email; + private String role; + + // Constructors + public UserResponse() {} + + public UserResponse(Long id, String name, String email, String role) { + this.id = id; + this.name = name; + this.email = email; + this.role = role; + } + + // Getters and Setters + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/entity/User.java b/src/main/java/com/example/userapi/entity/User.java new file mode 100644 index 0000000..008a576 --- /dev/null +++ b/src/main/java/com/example/userapi/entity/User.java @@ -0,0 +1,69 @@ +package com.example.userapi.entity; + +import jakarta.persistence.*; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +@Entity +@Table(name = "users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotBlank + @Column(nullable = false) + private String name; + + @Email + @NotBlank + @Column(nullable = false, unique = true) + private String email; + + @NotBlank + @Column(nullable = false) + private String role; + + // Constructors + public User() {} + + public User(String name, String email, String role) { + this.name = name; + this.email = email; + this.role = role; + } + + // Getters and Setters + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/exception/GlobalExceptionHandler.java b/src/main/java/com/example/userapi/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..10d42cc --- /dev/null +++ b/src/main/java/com/example/userapi/exception/GlobalExceptionHandler.java @@ -0,0 +1,49 @@ +package com.example.userapi.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(UserNotFoundException.class) + public ResponseEntity> handleUserNotFoundException(UserNotFoundException ex) { + Map errorResponse = new HashMap<>(); + errorResponse.put("timestamp", LocalDateTime.now()); + errorResponse.put("status", HttpStatus.NOT_FOUND.value()); + errorResponse.put("error", "Not Found"); + errorResponse.put("message", ex.getMessage()); + + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(errorResponse); + } + + @ExceptionHandler(AccessDeniedException.class) + public ResponseEntity> handleAccessDeniedException(AccessDeniedException ex) { + Map errorResponse = new HashMap<>(); + errorResponse.put("timestamp", LocalDateTime.now()); + errorResponse.put("status", HttpStatus.FORBIDDEN.value()); + errorResponse.put("error", "Forbidden"); + errorResponse.put("message", "Insufficient permissions"); + + return ResponseEntity.status(HttpStatus.FORBIDDEN).body(errorResponse); + } + + @ExceptionHandler(BadCredentialsException.class) + public ResponseEntity> handleBadCredentialsException(BadCredentialsException ex) { + Map errorResponse = new HashMap<>(); + errorResponse.put("timestamp", LocalDateTime.now()); + errorResponse.put("status", HttpStatus.UNAUTHORIZED.value()); + errorResponse.put("error", "Unauthorized"); + errorResponse.put("message", "Authentication failed"); + + return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(errorResponse); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/exception/UserNotFoundException.java b/src/main/java/com/example/userapi/exception/UserNotFoundException.java new file mode 100644 index 0000000..402bb0d --- /dev/null +++ b/src/main/java/com/example/userapi/exception/UserNotFoundException.java @@ -0,0 +1,7 @@ +package com.example.userapi.exception; + +public class UserNotFoundException extends RuntimeException { + public UserNotFoundException(Long id) { + super("User not found with id: " + id); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/repository/UserRepository.java b/src/main/java/com/example/userapi/repository/UserRepository.java new file mode 100644 index 0000000..c7bd0fa --- /dev/null +++ b/src/main/java/com/example/userapi/repository/UserRepository.java @@ -0,0 +1,9 @@ +package com.example.userapi.repository; + +import com.example.userapi.entity.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface UserRepository extends JpaRepository { +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/security/JwtAuthenticationFilter.java b/src/main/java/com/example/userapi/security/JwtAuthenticationFilter.java new file mode 100644 index 0000000..afde6a8 --- /dev/null +++ b/src/main/java/com/example/userapi/security/JwtAuthenticationFilter.java @@ -0,0 +1,49 @@ +package com.example.userapi.security; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; +import java.util.Collections; + +@Component +public class JwtAuthenticationFilter extends OncePerRequestFilter { + + @Autowired + private JwtUtil jwtUtil; + + @Override + protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, + FilterChain filterChain) throws ServletException, IOException { + + String authHeader = request.getHeader("Authorization"); + + if (authHeader != null && authHeader.startsWith("Bearer ")) { + String token = authHeader.substring(7); + + if (jwtUtil.validateToken(token)) { + String username = jwtUtil.getUsernameFromToken(token); + String role = jwtUtil.getRoleFromToken(token); + + UsernamePasswordAuthenticationToken authentication = + new UsernamePasswordAuthenticationToken( + username, + null, + Collections.singletonList(new SimpleGrantedAuthority("ROLE_" + role.toUpperCase())) + ); + + SecurityContextHolder.getContext().setAuthentication(authentication); + } + } + + filterChain.doFilter(request, response); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/security/JwtUtil.java b/src/main/java/com/example/userapi/security/JwtUtil.java new file mode 100644 index 0000000..ec0805f --- /dev/null +++ b/src/main/java/com/example/userapi/security/JwtUtil.java @@ -0,0 +1,68 @@ +package com.example.userapi.security; + +import io.jsonwebtoken.*; +import io.jsonwebtoken.security.Keys; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.crypto.SecretKey; +import java.util.Date; + +@Component +public class JwtUtil { + + @Value("${jwt.secret:mySecretKey12345678901234567890}") + private String jwtSecret; + + @Value("${jwt.expiration:86400000}") + private long jwtExpiration; + + private SecretKey getSigningKey() { + return Keys.hmacShaKeyFor(jwtSecret.getBytes()); + } + + public String generateToken(String username, String role) { + Date now = new Date(); + Date expiryDate = new Date(now.getTime() + jwtExpiration); + + return Jwts.builder() + .setSubject(username) + .claim("role", role) + .setIssuedAt(now) + .setExpiration(expiryDate) + .signWith(getSigningKey()) + .compact(); + } + + public String getUsernameFromToken(String token) { + Claims claims = Jwts.parserBuilder() + .setSigningKey(getSigningKey()) + .build() + .parseClaimsJws(token) + .getBody(); + + return claims.getSubject(); + } + + public String getRoleFromToken(String token) { + Claims claims = Jwts.parserBuilder() + .setSigningKey(getSigningKey()) + .build() + .parseClaimsJws(token) + .getBody(); + + return claims.get("role", String.class); + } + + public boolean validateToken(String token) { + try { + Jwts.parserBuilder() + .setSigningKey(getSigningKey()) + .build() + .parseClaimsJws(token); + return true; + } catch (JwtException | IllegalArgumentException e) { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/security/SecurityConfig.java b/src/main/java/com/example/userapi/security/SecurityConfig.java new file mode 100644 index 0000000..8818c7d --- /dev/null +++ b/src/main/java/com/example/userapi/security/SecurityConfig.java @@ -0,0 +1,39 @@ +package com.example.userapi.security; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableWebSecurity +@EnableMethodSecurity(prePostEnabled = true) +public class SecurityConfig { + + @Autowired + private JwtAuthenticationFilter jwtAuthenticationFilter; + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + http.csrf(csrf -> csrf.disable()) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authz -> authz + .requestMatchers(new AntPathRequestMatcher("/api/users/**")).hasRole("ADMIN") + .requestMatchers(new AntPathRequestMatcher("/h2-console/**")).permitAll() // For testing + .anyRequest().authenticated() + ) + .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); + + // For H2 console access (testing only) + http.headers(headers -> headers + .frameOptions(frameOptions -> frameOptions.sameOrigin())); + + return http.build(); + } +} \ No newline at end of file diff --git a/src/main/java/com/example/userapi/util/TokenGenerator.java b/src/main/java/com/example/userapi/util/TokenGenerator.java new file mode 100644 index 0000000..1ec26f3 --- /dev/null +++ b/src/main/java/com/example/userapi/util/TokenGenerator.java @@ -0,0 +1,27 @@ +package com.example.userapi.util; + +import com.example.userapi.security.JwtUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Component; + +@Component +@Profile("token-gen") +public class TokenGenerator implements CommandLineRunner { + + @Autowired + private JwtUtil jwtUtil; + + @Override + public void run(String... args) throws Exception { + String adminToken = jwtUtil.generateToken("admin@example.com", "ADMIN"); + String userToken = jwtUtil.generateToken("user@example.com", "USER"); + + System.out.println("Admin Token:"); + System.out.println(adminToken); + System.out.println(); + System.out.println("User Token:"); + System.out.println(userToken); + } +} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..fa78775 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,29 @@ +# Server Configuration +server.port=8080 + +# Database Configuration (H2 for testing) +spring.datasource.url=jdbc:h2:mem:testdb +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# JPA Configuration +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true + +# Disable automatic SQL script execution +spring.sql.init.mode=never + +# H2 Console (for testing) +spring.h2.console.enabled=true +spring.h2.console.path=/h2-console + +# JWT Configuration +jwt.secret=mySecretKey12345678901234567890123456789012345678901234567890 +jwt.expiration=86400000 + +# Logging +logging.level.com.example.userapi=DEBUG +logging.level.org.springframework.security=DEBUG \ No newline at end of file diff --git a/src/test/java/com/example/userapi/UserApiApplicationTest.java b/src/test/java/com/example/userapi/UserApiApplicationTest.java new file mode 100644 index 0000000..c6af287 --- /dev/null +++ b/src/test/java/com/example/userapi/UserApiApplicationTest.java @@ -0,0 +1,15 @@ +package com.example.userapi; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; + +@SpringBootTest +@ActiveProfiles("test") +class UserApiApplicationTest { + + @Test + void contextLoads() { + // This test ensures that the Spring context loads successfully + } +} \ No newline at end of file diff --git a/src/test/java/com/example/userapi/controller/UserControllerTest.java b/src/test/java/com/example/userapi/controller/UserControllerTest.java new file mode 100644 index 0000000..873eba4 --- /dev/null +++ b/src/test/java/com/example/userapi/controller/UserControllerTest.java @@ -0,0 +1,114 @@ +package com.example.userapi.controller; + +import com.example.userapi.entity.User; +import com.example.userapi.repository.UserRepository; +import com.example.userapi.security.JwtUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +@SpringBootTest +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) +@ActiveProfiles("test") +class UserControllerTest { + + @Autowired + private WebApplicationContext webApplicationContext; + + @Autowired + private UserRepository userRepository; + + @Autowired + private JwtUtil jwtUtil; + + @Autowired + private ObjectMapper objectMapper; + + private MockMvc mockMvc; + private String adminToken; + private String userToken; + private User testUser; + + @BeforeEach + void setUp() { + mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); + + userRepository.deleteAll(); + + // Create test users + testUser = new User("Test User", "test@example.com", "USER"); + testUser = userRepository.save(testUser); + + User adminUser = new User("Admin User", "admin@example.com", "ADMIN"); + adminUser = userRepository.save(adminUser); + + // Generate tokens + adminToken = jwtUtil.generateToken("admin@example.com", "ADMIN"); + userToken = jwtUtil.generateToken("user@example.com", "USER"); + } + + @Test + void getUserById_WithAdminToken_ShouldReturnUser() throws Exception { + mockMvc.perform(get("/api/users/{id}", testUser.getId()) + .header("Authorization", "Bearer " + adminToken) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(jsonPath("$.id").value(testUser.getId())) + .andExpect(jsonPath("$.name").value("Test User")) + .andExpect(jsonPath("$.email").value("test@example.com")) + .andExpect(jsonPath("$.role").value("USER")); + } + + @Test + void getUserById_WithNonAdminToken_ShouldReturnForbidden() throws Exception { + mockMvc.perform(get("/api/users/{id}", testUser.getId()) + .header("Authorization", "Bearer " + userToken) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isForbidden()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(jsonPath("$.status").value(403)) + .andExpect(jsonPath("$.error").value("Forbidden")); + } + + @Test + void getUserById_WithoutToken_ShouldReturnUnauthorized() throws Exception { + mockMvc.perform(get("/api/users/{id}", testUser.getId()) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isUnauthorized()); + } + + @Test + void getUserById_WithInvalidToken_ShouldReturnUnauthorized() throws Exception { + mockMvc.perform(get("/api/users/{id}", testUser.getId()) + .header("Authorization", "Bearer invalid-token") + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isUnauthorized()); + } + + @Test + void getUserById_WithNonExistentUserId_ShouldReturnNotFound() throws Exception { + Long nonExistentId = 999L; + + mockMvc.perform(get("/api/users/{id}", nonExistentId) + .header("Authorization", "Bearer " + adminToken) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isNotFound()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) + .andExpect(jsonPath("$.status").value(404)) + .andExpect(jsonPath("$.error").value("Not Found")) + .andExpect(jsonPath("$.message").value("User not found with id: " + nonExistentId)); + } +} \ No newline at end of file diff --git a/src/test/java/com/example/userapi/security/JwtUtilTest.java b/src/test/java/com/example/userapi/security/JwtUtilTest.java new file mode 100644 index 0000000..69ec293 --- /dev/null +++ b/src/test/java/com/example/userapi/security/JwtUtilTest.java @@ -0,0 +1,68 @@ +package com.example.userapi.security; + +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.ActiveProfiles; + +import static org.junit.jupiter.api.Assertions.*; + +@SpringBootTest +@ActiveProfiles("test") +class JwtUtilTest { + + @Autowired + private JwtUtil jwtUtil; + + @Test + void generateToken_ShouldCreateValidToken() { + String username = "test@example.com"; + String role = "ADMIN"; + + String token = jwtUtil.generateToken(username, role); + + assertNotNull(token); + assertFalse(token.isEmpty()); + assertTrue(jwtUtil.validateToken(token)); + } + + @Test + void getUsernameFromToken_ShouldReturnCorrectUsername() { + String username = "test@example.com"; + String role = "ADMIN"; + String token = jwtUtil.generateToken(username, role); + + String extractedUsername = jwtUtil.getUsernameFromToken(token); + + assertEquals(username, extractedUsername); + } + + @Test + void getRoleFromToken_ShouldReturnCorrectRole() { + String username = "test@example.com"; + String role = "ADMIN"; + String token = jwtUtil.generateToken(username, role); + + String extractedRole = jwtUtil.getRoleFromToken(token); + + assertEquals(role, extractedRole); + } + + @Test + void validateToken_WithInvalidToken_ShouldReturnFalse() { + String invalidToken = "invalid.token.here"; + + boolean isValid = jwtUtil.validateToken(invalidToken); + + assertFalse(isValid); + } + + @Test + void validateToken_WithEmptyToken_ShouldReturnFalse() { + String emptyToken = ""; + + boolean isValid = jwtUtil.validateToken(emptyToken); + + assertFalse(isValid); + } +} \ No newline at end of file diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties new file mode 100644 index 0000000..65a0671 --- /dev/null +++ b/src/test/resources/application-test.properties @@ -0,0 +1,25 @@ +# Test Configuration +spring.profiles.active=test + +# Database Configuration (H2 for testing) +spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# JPA Configuration +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=false +spring.h2.console.enabled=false + +# Disable automatic SQL script execution in tests +spring.sql.init.mode=never + +# JWT Configuration +jwt.secret=testSecretKey12345678901234567890123456789012345678901234567890 +jwt.expiration=86400000 + +# Logging +logging.level.com.example.userapi=INFO +logging.level.org.springframework.security=WARN \ No newline at end of file diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 0000000..fa78775 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,29 @@ +# Server Configuration +server.port=8080 + +# Database Configuration (H2 for testing) +spring.datasource.url=jdbc:h2:mem:testdb +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# JPA Configuration +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true + +# Disable automatic SQL script execution +spring.sql.init.mode=never + +# H2 Console (for testing) +spring.h2.console.enabled=true +spring.h2.console.path=/h2-console + +# JWT Configuration +jwt.secret=mySecretKey12345678901234567890123456789012345678901234567890 +jwt.expiration=86400000 + +# Logging +logging.level.com.example.userapi=DEBUG +logging.level.org.springframework.security=DEBUG \ No newline at end of file diff --git a/target/classes/com/example/userapi/UserApiApplication.class b/target/classes/com/example/userapi/UserApiApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..9935c9b5c31c0910e9f9c737f4ba9af2571618ec GIT binary patch literal 748 zcma)4OHbQC5dJnKIHcjxP@udHTu{iNd*c#{1d)0&P&E(^oYrPB3-+$HUITxtr&c}m z2lPiFW?iI2A_pvaM)Ue+_M7?l{O2!#uh?#(hM55MHX4{^Sh^Drf~P_!{4BbYv16D$ zP+GY|hMDf(C_s~8H#QlUPa?}x$;(1okt=>d`Y2aNd7i3RIAwGTEqn;jZetz`3_W8L zUgTEkSasK5Ou@xJcCpeMgMBTGjtxTzZXtJj*WKm$?<{F zH!3Nuh*CMxg4{mbXQ&U%wPaWfm6oSv7D;>Va~V3JiA6dRR(bo?S$DUpVCaVL-O6^o8 zN2*Z%=~^3Ct%V>Cr!rRULX^%Bbrogubu-7bqzUT!*g-&N}M5TBI(1Rl8+?Y{}a%`GFfx@gcSnu#rqW)(Ch@g-J82|tP literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/config/DataLoader.class b/target/classes/com/example/userapi/config/DataLoader.class new file mode 100644 index 0000000000000000000000000000000000000000..570a8f72bf0988f24271a7410521fe8f5aa3efdf GIT binary patch literal 1308 zcmb7E*-leI82+XOT1wdto45fgOHnxPf<>eOjGBU`g&O14a5|KMcBVOJ%5v#Dc;&56 zU}8eh#0T(|OpO1Orj*bNz3BYs-@bqEuRq^^0(gd03?YOgXo;g0Z45oTe4o2Tt_tp( ztzF?6hPDN%q*-JLPbG5gh@w4$SR5UQGmLw>G+ic1W=-11AcdS?kDipvC^T3LIw9z!3l+AdyWn4e0Y z^)YLFsS3$|ktA}q&XG7qF~-mm@O{BB(Fk@rlw_g-ttN`%CPO?U3Y8-FYdMe8KyByG zr#wl}o7vS&6bXj*4H1}{`E4>c#5S5oFvBpd{el~mZ5`V_FNp)~@3~uA8+TckN?hgB zQi)7ODLd<7`Y^I2ax#!xMUhfU8*Zdl0mEFnDU#qSaJRWZ9}bBN?XF;-~`X$q_xM3Iqpl#*Mu!*M^e1WrfYU#K?y$WR}{nG)Q5)7)+U$8 zQFQJX2(Pb+nxQjmxVN{)%eCOK)k9B|t0hOUKwf9dP}fka*M!;8`M2D5)Ciy8V_9AC zJ@G=?y1LH}Xx0MI7@Br3AYY-)QCZk&l(nKYPGXD>H3Wt`^b6TzB|1wd-$v9WYISt+ z^xh@TCCZ4lP9KAPt*Yrxa)7(KlL1It7=Xe1bK5R?TktE!PDqqj8Fe`&aSz9wb-TPfmpYPKB&wtPV0&pEs5e4jV(B+~VJq)FX z;<4bq2v+&M+C%9XhMsFGQ04~1p7Qu|A9~T}py;9>F2fm5H@SQwnxQXw63a-0ihDXR zk@kHV@%ywiwK-+jYh@N>sAFYxw86luc^0BgiPXZDLZu&jvCl!t#oHLz!T*lh481EV zsNdX}sWX(z)mQgg8E-8mM)~|+Xp|0wUl|~x4!C#+2Z@4JNsREUYE=iT9f~VS;8|6^ zn1rFPWK=2QT?{!mYJ)}b04YqM+!c=i^l;Kz& znKCfSY@|dwILeDY*i@1V{rQ#aH{w#!6(k(L#EhL1qDVJ5OYQCHd z0&RrNzL?=kF2I@;LCjZ#XA6*vO$9!g7`?6{S+6j3P3bxXa$i*iaxQ7sWV9s6Jmo-D zd%|B9k+SplVwY(s@|R!BJ9Yzd(@%L|TSTiOE8BONyMvrCk*$KF6fI?vA?1j+Vp|Tw zaBic?)CQU8joPtiIGHQ{YL$>qX;zwsuFngbMMg%%L*JrW4TMP|;>&yUJzd)!gc}6n zVlGeXvc_xF@3KL@Bh9P`LtBtk*pG#u5Xf%+ldAvBa5dLVEWISM9YlDZjAI_A{nhaK zNK(o)bfkWimWYOkZTXhRCU4Eo%#DpRjC3aFCPy7vdMVdw9`<=*8ZR@C93JpRvsM?Q znH(BD$8aZy@i!SRQz4D`x8?BZW z6}dfTZC+Ehm2PTnVnZiyD-+{=J@~$eA0QmmTzH_e7}+}MRPb1@NnTC4BMs5+1XPTa zzgx3^voyAqS`O}tpzh0fw5s)55>_%5x4j{EC@yV;GAq9OKU*$eubVxa+Lot;?=LDN zDIFZ#T(w#=RSjHD6P_MsCr`MY$j5`wqbl>qs9Lv~2z;I$4@p&9N2pNvP zUX<=(Ey6KOa0_%Np_XSaVKiQ+Sr3gjXxu|1-Q?)~G0ixQjK=PXXJEh4M**ME+x`u@ zNlnt*8Xy7O#1xGTw=hjJtNaVebQ^ z1U=*QoPGvAcjga#@GI%He2oxX;2=sEq~8z@;}DM1MQD`1%5?m5npqqZEnjUMm|D#>><5&&lDDPS(;V35Aw-qPD7rvv2lE1Hwfw&QQ`EzK>j V-;sHVRXl`GD@9sqLgNvJ{s;9HVov}7 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/dto/UserResponse.class b/target/classes/com/example/userapi/dto/UserResponse.class new file mode 100644 index 0000000000000000000000000000000000000000..ac87eae0ddd5a8e29f71648a0f8daddefda6201c GIT binary patch literal 1468 zcma)*T~8B16o%g^yDii$rR77ZqJp690&Xdpz=X~s+zrTJ1c!jMp3YaRva$uvVFn8vE_Pw4zIPu;e zpXpAlP<$B-f_PV9s@Xc4!8B${C_A_XM`67a_C5W@@1OUycQMqFe;#<#a!&uW;?rQL@VI>w`W=P6W(LckXU-|+ zP5x;eu?p{Wd>VE?_z@G1bwm#PM8|t9P`%m8sF-(nIZQ6+|6>rf5<~Y*Hnu z1iPCfl-#WmD(?0OHFwz>VPUM;pr&Y9s9*-O{8eSH_(ILR@*+`6U!kT+Lns<15lOCL zBBsnvlCiMDea)gP=mcJaqbZR0@qp{q41b{Xjh6+CGhEEg@FB~YWVlN!FBeUA<80*1 z1!HY8NsX2gFP@}EQa@>eGJLi&d7PO~muX>=X*-vxmCux!#H4r6$n^Xg QCYh~ErevO6k`=J|4=<MsbnF3`gC#d((JTVQ+v=5AT`-ifk z1?5(ht@N6p^vrCzo!Y29PaOs7q=KOFic>S>H?wwZNyGP~YaS~@+FI#T<0C{t8QZK$ zLH*koz#p`$?1N>7>Ml?Z<78#cR2FOc3e?Y|0ND z-Ld?d%{*-1vP{&M#@I;ESYy?kyP@(sFcCP z?Mru$lk)tWifNTiSFs!^Gy01{mnXL`*#e|lngOBn&59P_Dw^3chW=LSFHZHn>0*^M z28n$+ka`RI&_BaHKF5tVBI||5VtvlQ#%Otj?gTqI&=4Gvf&;=shiml!k)0vh01@<$ z_apvf;9V?jh!B2td~kfXB3~<3xATjbXS%J%y&1e5v}+_DU;Q=&ZHG0>FU_M#yp9yM zA%hc71Y2<(QXixt+{2J>NE)G0DDYTuvbhKM819=ekAJ2Kpb&6Gkpgv!-(%!DL}|JO zYv`T|-KRd&bP&@`Da61YN8;UHElCG*<8OoWHsB510(Z9bi^LCnr05P#HgoQ~I18Zz z&Co0)4lcoqgDu<{+yfk3x_3tT()}~)D$Siy?*-N%B8bM}IYI4U-wobHnhLN>VSI!Q zq@Y=xdm!ose{pSTx(97n8V=k?f|AMHr#YOBmHedQcNps{xtmzYJjxF%S;NiK%yAXP z3-0`bCS=Yc5%*#+^osfBqS-UItbo9r9?-)CPWfg|Mk1$2w16C3Py?rYGp7Y`dfb8& zFPsSa1y0;A0oNo>UCo>p6FEIe=G4{9X&IbWT5#gcjyduC1U*gU)Z5JIMIxugWKMN^ i7tU@SoHkl;;=PJF@jj*KS#U1Juk|_PWjJ+uwDKPrvRL~7 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/exception/GlobalExceptionHandler.class b/target/classes/com/example/userapi/exception/GlobalExceptionHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..e5e11208821614b112ddd1e5faf6897fa9bc96da GIT binary patch literal 3468 zcmcguZC4XV6n=)c4PjNJDxy^pQG=pet5|E0Hjp5xkXYWV+EypKlQ6j1&Dj@_{*iv_ z=YHy`?FXgpIsF0sQ9Zr0Nibldk#lNtcC&N$&YkDE_nDjd=ifj725<+JI6Ba&p-V?M zdKmiG`35&^?v#vtVO^L3L(imiWH80hnHXEu5MwwTIfa3=jXCbGEpUpWp)-a)hTcGy zg&*)T*$&{KhC@2~ahPE+nxx(u^RCJ5G!MiwjVP|;ZZe!qjLo-jN%r9*9MN!8$1w~t z9C*DxtxW+cA>q80sLpQypM29&Tcpt`h9P1}n1j&o#Yudu;gpWkIKyzx^-6|c@uX8K zdb}()UGJH(76cVzj&4iQ6yluAFF%>hujJAU=jYp)l8nWPl9W}QHkgvX#o?)f6au|&3!P0b@2!(|F8JkRxFxT4Ux!SJjbI#vt@ z&8PDCyd>hdhEFwI*Kq?A4A)J!Y>4MnH(MB?FFan6G&V&gkgj8_kcHwzVKQ|qL%bw{ zg=##8BlQYKfR_T5HDdZ1ZfW>j#}IBaTx^-0Md4Rm#}^qVkiizi(?mO&oN+CY9Bb{l zJL>4PYi&)3(zb+0qMF1V4O2S4z?YPOHjy>PVCX7PM20&}wAVJOq!QhA@X>wKH;Ubr|ur%Cfxbb!++_l{Tw|6u!#~sU7 zy6jS=U^p}{9gz#m1>r68f=!lzXuGd+PpWav*cGfvpW){Geilnow^)nTZ6Qn2&fDWQ zo!7pO2tbE;&M>jBWvGEgyR)uMm9$+Qjlv(>owTh=J#iDeT_+nlTy4iSSgI{NIYj~c z7X%5wy3bV`3xr3>?_H85hnk*8Mf&l7&R7j+^q)aJyG_^%_|RfVGA)Z$=}Xd2%5hw3 zyGrv6x0`PKO;Iok(yAwfw}+covQBBX>QGUg1T5Bx$QTkx$-XjyV{h|BF=jyJoAo(x3?n0 z&mS22{)-S_azoD)v((~A_RSmkRn>tQrkWO-i!`m3GTP_WZ*B`H5 zeu+=219IEOO?s2;zzYi389_KfAV7!D7>>~QC@#<$JPpGjar;(A9yb;PiWtoC43(uR!(tPLDo6=y zZ8MzP%kbW7h6{Cub1fN;5yMNw@G>zRCx%yuq0y3|d|!s^O&Ch5+Ow#_cJx;1xlCh+ Ot~fnU($U!M>HQDS1Lhh4 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/exception/UserNotFoundException.class b/target/classes/com/example/userapi/exception/UserNotFoundException.class new file mode 100644 index 0000000000000000000000000000000000000000..000b547c1effa99259767d0fc1083a6fd04c7ba2 GIT binary patch literal 941 zcmbVL&2G~`5dPLAahe8FTH2BT#Xt%aBz!0X)aORT5Sk7f@r^jQCs(weq?7B+ZO= zso~0`4E_7w0YBt!$ko2NP=2uz_!tBV+k#W-kHaTOc@!8S4X~xjns;v z@k}adUNEdznMDw^WLKM!&QwrgUaJxop-vcT zLmdc)jwhAa&7!GD_V_d;WYyC?4<|g4xn6=bGn16{6YoDF7%*5eU|6XX=rjz1-U>6* z!F!(YNEngO6|J$(5?_pD9!qawN{{k7lJiTgO=_qJ1xwm#px44RT(@x}Z{QZS>8#{Z z9qPGoi;5OK9dY02l9hv8TnF=)bJ=;l>$ls3+nytU3(8bwD2PaVe4exsB~h9OT=k=nS!u>Duc zi!!mX&9L=vQyR)5ZQQ~#jdK1ldY5n!7A}!CBx#Xce(>;w4)6o@@1$Dj(AqjZs*`MB xh4hWW6qk|zV&sH1Tp_P@+SeH=pq_2eYGD&sNjB-QOW#epKc{23jXv(8`v<(w2UGw6 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/repository/UserRepository.class b/target/classes/com/example/userapi/repository/UserRepository.class new file mode 100644 index 0000000000000000000000000000000000000000..8032031a6c5ca03041b32f1013dfd6490a8e5e79 GIT binary patch literal 434 zcmbV}!Ab)$5QhI$?b@m!c=8!UbMmw*c<~?$LW|y~>lm``W6V<)SF?ueRA8uZEWzmLgLUREP{)rF?)5Dt(v7EO;-#krP+>H+#!>16D?C?!(Pi~7 z>`ArC7Q1BAx21AvQYFrmXQje;Dt)N=!nRq<-f!nepUM>WCw+!=d}E`XwS4ZJBuZ9X rR5)0vH6{)$Y3^AsY?t}N6xMQVGPTp}of83h4xO-wOUKtoUW*j>Yb*_R&? ze@4#9aXlv=^C7<}CnvXhW{`n#Ip)JuSJk}t>b?7Jy;pz#`}|J;XYp$aO=z}|u+f56 zf#X3q=S0QO_2*_oSy1I5Ty)B6#+h|JtwLwa@0PN)YZ73tx4Q=s*X>%01#Kyy#; zbP`E{_6sFFAB65hsolVDLkevcY#Z&^EO2l^F3M0#CsN^(r?fM#bPP#JtjxniTn+^>yre-VNh5V=(BOi2y{?jBJf`RY2k>#SR?+d zhAZo0b!zsFbgReE33qs`>%cL72opcSg<~@d6s!?FRyI=1_hDQx zrw7|z!amm84jmsDjIR9p_a{;kk*3M*=#)QPIM*=Uts3|g| zx@COp&Azk6OdGD?3kz8rS8+|C|D7!fY>m{qyC!h5=Pi7zXC(n^!#J*6n6NR4DS=(< zt6Aj^56w&07f9xV+MT{=(o|pg>g!$R)&ECDQbqA_f%HU)<)Wab-N>Es)CJ!UbX+?~ zrPB@LnNiY@oLQOELAc_`RRxEk1!Xr>`HVnfD9H0VY{|O5x>hR8sBlWsyg+9*$VqQn zhOSvxHxqi^<$0&xSe)w7t3biiI%=?tk~%ChEOgOEcwW&LHsZ8VunO1)MAsxIMl)$@ zvMF*V(Dm)Xz!I{?32Zh6=4F`{xZV)y|5539R*N=OnB6O^v{wOBn(7&|G19mbQ#%=| zO3(s*Z=qHNh~;oL?&4Lx?%ANa7BTiq14OMQw@+%BTf8cZRaT@fE$37*E^8JTNY{Gr zt9)M-vrrV+7Q^la&gj_cA7sc?#gd*Mm*yElj*xAs$)FVG6dhtlcE6%`9yQhs1PyBi z4XHq{6ctNwfp>~2HEbLV0?oEAi1vfp;yXUnCdRUt?h65X)c4r|J$7CdS@=<4|4V=BPOo>{!p{PGUoXmIDluXo-$G4n zrGg`0L;T+0s+Heqew+B^qm$!Jt{i>^zb$=FAbyYkzQxh}4L0xF9PNq#?%*z03Eab% zXg12?AS`U+Uina`^$eSuFpx+m{=!T;(YfU@wm!nGbfUw0jGY55eSctAy5%wUJ;G3J zeqf-rHtij-Uf}TUbgOuQqqo!4IrbbUfG7CuDF&Y4^MT}345gFLFxrG8hYml(STl^f z%`omBMH|OmeDChzgK;k(R9)QLhknj3q8r!wy2|qbNe2#YmSi50}2AP{0B;5?G{865=2D7Gdq;U5JUuDfMP{ZD-Wyo6^6?Ym`SEdMwnV#`+nEH zeuf{~wYpT=)vkW-kLv2anRI4=@gd73lY7rO`|h*PIr-<`-~R$|3O~mYK~zIbM+LSC z>|8c)n?}mClg5?#Wts2=ww<(W%Rem;ZEK&a#CB9_i0i0=E^s*Eqz$=drZXvNWIgGc z8O!iwBI{ay&X`#BXMHOrP`SM7Ps@ZW>8^IN7-HIYEju|JM-6sp*s0?M)Na6#-ypC( zDgDu$FFk=+Tl=liIO?!l!yX+kVy{4x&Ccr?X*Zd)l_<;;E6gqn}4`os?8D z2Xq|Apg=_;Wm;*0(K7Bz0_62H{L}!-?U0UPoD`@c)Qg^%l?x-3O?T+LkdkLRI<4c3 za#T%6#f-$6s}UWe7~=}FIBg|uijbKnbtGCPzKkjqvhzB|ae->|Xmj22mjrr4SOv{1 z1wHeK7j;bF5>w3b$(X9h>cYtR(ks+O8>Vzz#uY-%m@exp%sDHsye6)e?xHeY#WfAn zI%Y5{&|F3t8w~PXl`?YtxzD%3Q4smMj@NL5`Ur%~Dt#JcTHM0x8s5< z=tb8|%T>o+G3KRdd&VLq>$o|?EEpJbW-2R(nd{r?L7?mK9rnR)mIa&sP&!v=uf0e6 z`i~79A3V`he7eiZ%kP(k#yK=N(BGr}aWOXLEYRnUNz0a(v*~&1&X~ljW{Hz9Q*)+k zso&wtn7?H404s1azBEN0nuRyoS@ zhQ+2uRRm|usj0&CDd{gc3#=U)`O+osI?7`{@|bhvlR z?8r-%N8ia<*VxTV;#4z%)d#1T4 z%gqL4X4=WR2{~@5)asPe$rxFb=ZANBDIU;UB+J zAmH&=74JU(XFc5J0%!Hsg;i|hOMVFPx<(s=cfor_$0LYe1D82o)iUV#-QXH*z#Y67 ztaGk}#>YbAs*c~FJw)|m?D{3xQgpGq#6?x;Lf|gmCqNbdPll@C{lXupzwrqBE~|Uj zLp0K5v-t>zhhmS>dSo445!Ci|uH#q~UF$dzL49l;ry}Thh_mZB7r{DS5h#Z5K%8#t zNmK*>8u?Argce>qaR7a2#tD)*LXO6{rcT+PhY>;~Abb!ItDgG#6rraxxQ7oBrN1tG z#HScOre$S>Ta^Qlj!*Duc(NStQNC+^jLAI6s|w_t08evMJ-#jQHx{ROD2~}8@&-}@ zVvV7daobRfc76kP5OZgMv^np#fV35#1xTBr;d6Y!unJX$;A@5G%L1Z%G*pPXpNXip zueN3#D^cRB*$k|Qzehf-X)x}T1e^vt?^#A|> literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/security/SecurityConfig.class b/target/classes/com/example/userapi/security/SecurityConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..020be66d4acde2d6644db94648e8d38b3242f3fb GIT binary patch literal 6484 zcmcgx`F|V575`3rtgUPuMF|0Omc$fWA#BJ2v`Rv3Vb@9I#I+o|3Fk-}TWha&#qP?E z!`T$dP3e6@OD~QdK&jH20)Zd-^l$2?Z+2JF+ELev?N2`WShG7j?|$=rZzf;Ft|H5LJhYPQ(~G^A*Rn zO8Pm$u(!7_W7*T1Q?_+;ddlV{F>l$knj`WRTXz?*SJac*QMRHaS$Yotbz0i7ScI^Pb~|bi)-k!`+!kM#mb{ zr4)RHVLUQcGBVPVx=ig9>1k3}JyeKqMNjhtXik;|T*vtzBU(o?EW!aQqmEOz@ zpXIj8$yj^N5U%DgNYQ*PWzz=nPpxYdTl^5+uA*0lNGS>~Gfpa-RIv+pFtmAT$gqv} zKwTGq`;foxWZ1u=ziM&wZAurpZYIzwW#5Ip3ihekj{^*&k&J>pwk$vW*^2G$6JL8j zJLD9D>TTAOWx1&whG(zNrioOFpy3|etKe%YzK#?_e!Z>k8Ik}M*z7xlA?C`Hu1xp0W#V5Bi}?^Imf&`R9R7lo|_C@|u`D!7j!ePtZ_O?Q;L#ifio(9f_* zlh`3K#L<$;7!D&X%fS7FL~^&)c2(Aun4apJh+zodP%y0GD2_3_7^#OJVJ*Tz5(F+o zyLxK&)V_PL<-?}E)QT}Ntvjy0K!9QUXc_p45;@!ZKs5ZX;A(=Ax(hCC<_v>zmCP1} zQ?}8869h2*_m3Ps5yNqes`w_xBn)w9%rXcU-)t1AXv42&WKta%XXw(3dv}vqhg9}5 z?Kmb>OyXPAM3jYH(%pW;V0d-yo355KODgE9a*9A`2xnA0AR#`+&4nQKWEdV&@vu~W z6R(#!QRu{@;0kgo@+dGIZYEEPROq#=-x;KB;idYhW$1az>CWtU|M*~LFq>sK(o{(Q zKR2>w3eyUTDs;>+oM}e6h`k%ATyJLTJ|^@CTAk$vz0q84iLhc-rQOeWzW_$)O)fG} zQedjEP-Yleql?nigoeGM6m*B@g`HmLU(lH-hZh> zCJel{Vb^29&28=MSeW3ZhAP^QkJf*B%kh zjW;A*0iA2W<1x_&OC3Fud#&IGfw?%NTxzUn_V+#hdsI!;X5n(9Jn(R%jUy=81v_Rh&vG=~93D zPxw?25cvXzxmhrT)045R*-ANlc@iA+LZ_Z3gyRck5nkT>M_*(#ZTPSia87f>$m*_0 z#qrj%6KQZ9>zg2N{XRzbV}DTbJ-i;r>ooDUoOnmY%XlS@S7_qTa^f#4p2rJuyg(E0 z%ZU$Ed>iNEI8PHF$%%iccoxsa@f_WW95qd0d$&n~%5dWH>jDLf3=cO--zKwAp1D`R zLxyB+MKed>O|`||!BN4d47XjDIgOG)!9|9fqnFY(u%9uwm0Yz!CNKTcg(QuS(OWx> zHjN66bdgNI4!vnKG8)^G7r;KChYfJ)SAGVzphCZ@zW{TXr#FVPSfG0^N&F;QJV6I` zEfQN)v2l@TXiO~P8aZxHeuVDCEmhn)NlR{%Q(v9jRYl)L?0%mZ_`3$3S+ld|6O%zgr?Y@ve0pI}6;c-&r3HsJbZ?7a0PQ*iLd|G}g`DNSBJ=@mNvj1+4baC|R{9tGGMF#dq4y5Oq7< z34Yh3rpykg=e!62N0P0d;Na<&k8${P;>ZOIWUCmwh~tToDo%zzW$T}+I90`IT2sY? zA-VDz5)|nzxB++IM)J>1Asvq3MZDzcK-(?QVPD{k&g6%9qzVyY<{Qx+V$g|K@tVhg zHgLco?1I_LsILoAx6}U}e4o^7#SiFr1Agd5Xe&AVNA&(<`uhp-{OK9|3_qur{gj)( zppU=B@9@Xq=}&k!czO?i4W9mn4}+(_Q!FnKqkJI>XV*d#~ I!{_M!AGIA*3;+NC literal 0 HcmV?d00001 diff --git a/target/classes/com/example/userapi/util/TokenGenerator.class b/target/classes/com/example/userapi/util/TokenGenerator.class new file mode 100644 index 0000000000000000000000000000000000000000..fb938c092120abaeb4b98075c0213f6e81d63f2a GIT binary patch literal 1403 zcma)6%W@M(6g_QA9!U%VBrrA!!MrU6d&m=lFhLkYLCMC2u{NyQQd_jqbgM=^*k1A} zd_t&{Q=>5(vTSqm03x4ZAX=broM{^#Gn{sypwrzK2aGC(dw9#aCRcjP-6 z^`z-WFSd46+X+nF*G9Vs0+aLARuKgh1C&CXKqzptZR1Go$++KBQ94kG?CU6Xx);5& zZPOQztQG`W07I0c1-*~+G zY^{VcDgn-hIEQJ0YhMB@aI!ljr80&Bcjud*bKY=?Hr@L1lj`xK0%lk*pY&0F7X)&f z8!Io1_y!jPd>i5t=8jZ$V}IaO%!1mK^*uL));3yaa7PMC#!UZ;K-lo<&t**Sm2eH$ z1KbF46Y~Ov-7#3t#F@B=Ig)NIm?1|Foloyb`2 z+T?AtWvz>rZ5&I}X=p%^=#AZO+7g zBo7^;M(XUYPE@DP>Mh%j5;)~Ut)=mnN?u9A3zVC-Eqg7QXulsF=G+_2c-65}HD(kU zU@}Qrpy~P7$D3MhF}_T?M68Ta3zV{n9L-MoIDkOWkHpBJw6fP${j4Mbe*4t4?0Ow) zI2xqZggO$_u0f7a66aEFDjQEaBQQoHXIzA)( zf6rY+DJb)`KOuh4)Iad=)u8i_{CfZz;3xb{`5wRE4kk0_50p8cE!F-&P(E2cb$~Og z+4_8Wmg}{T__}=g09Pq*4aEVf{_wluZh_)+&?{sPz84`XnBjXdhiP7d^UP$1p=WU) z7cxS%VbBpF|3coyuOu0g)IHRh;S8?Rx=wmaM9fk501vs!bLJ@~(8&Ievci + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml b/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml new file mode 100644 index 0000000..01e2f1c --- /dev/null +++ b/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml @@ -0,0 +1,1724 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml b/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml new file mode 100644 index 0000000..befec8f --- /dev/null +++ b/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml @@ -0,0 +1,1724 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt b/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt new file mode 100644 index 0000000..7bc094b --- /dev/null +++ b/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt @@ -0,0 +1,116 @@ +------------------------------------------------------------------------------- +Test set: com.example.userapi.UserApiApplicationTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.052 s <<< FAILURE! - in com.example.userapi.UserApiApplicationTest +com.example.userapi.UserApiApplicationTest.contextLoads Time elapsed: 0.001 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@544630b7 testClass = com.example.userapi.UserApiApplicationTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + diff --git a/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt b/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt new file mode 100644 index 0000000..6c60149 --- /dev/null +++ b/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt @@ -0,0 +1,564 @@ +------------------------------------------------------------------------------- +Test set: com.example.userapi.controller.UserControllerTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.161 s <<< FAILURE! - in com.example.userapi.controller.UserControllerTest +com.example.userapi.controller.UserControllerTest.getUserById_WithNonExistentUserId_ShouldReturnNotFound Time elapsed: 0 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.controller.UserControllerTest.getUserById_WithNonAdminToken_ShouldReturnForbidden Time elapsed: 0.001 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.controller.UserControllerTest.getUserById_WithoutToken_ShouldReturnUnauthorized Time elapsed: 0.002 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.controller.UserControllerTest.getUserById_WithInvalidToken_ShouldReturnUnauthorized Time elapsed: 0 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.controller.UserControllerTest.getUserById_WithAdminToken_ShouldReturnUser Time elapsed: 0.001 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + diff --git a/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt b/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt new file mode 100644 index 0000000..b814c88 --- /dev/null +++ b/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt @@ -0,0 +1,564 @@ +------------------------------------------------------------------------------- +Test set: com.example.userapi.security.JwtUtilTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.72 s <<< FAILURE! - in com.example.userapi.security.JwtUtilTest +com.example.userapi.security.JwtUtilTest.getRoleFromToken_ShouldReturnCorrectRole Time elapsed: 0.008 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.security.JwtUtilTest.generateToken_ShouldCreateValidToken Time elapsed: 0 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.security.JwtUtilTest.validateToken_WithInvalidToken_ShouldReturnFalse Time elapsed: 0 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.security.JwtUtilTest.validateToken_WithEmptyToken_ShouldReturnFalse Time elapsed: 0.001 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + +com.example.userapi.security.JwtUtilTest.getUsernameFromToken_ShouldReturnCorrectUsername Time elapsed: 0.001 s <<< ERROR! +java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) + 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) + at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) + at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) + at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) + at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) + at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) + at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) + at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) + at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) + at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) + at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) + at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) + at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) + at java.base/java.lang.Iterable.forEach(Iterable.java:75) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) + at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) + at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) + at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) + 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:1406) + 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:187) + at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) + ... 73 more + diff --git a/target/test-classes/application-test.properties b/target/test-classes/application-test.properties new file mode 100644 index 0000000..b1e97ed --- /dev/null +++ b/target/test-classes/application-test.properties @@ -0,0 +1,22 @@ +# Test Configuration +spring.profiles.active=test + +# Database Configuration (H2 for testing) +spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# JPA Configuration +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=false +spring.h2.console.enabled=false + +# JWT Configuration +jwt.secret=testSecretKey12345678901234567890123456789012345678901234567890 +jwt.expiration=86400000 + +# Logging +logging.level.com.example.userapi=INFO +logging.level.org.springframework.security=WARN \ No newline at end of file diff --git a/target/test-classes/com/example/userapi/UserApiApplicationTest.class b/target/test-classes/com/example/userapi/UserApiApplicationTest.class new file mode 100644 index 0000000000000000000000000000000000000000..c0953ed566900bb423f05a69e8d1b5c4d4800570 GIT binary patch literal 622 zcma)3yG{c!5M1X8A&?MWLQqgbKv*<1Jfs7O>I8^{G*rHe6E@u0C!a6mx2TXP_y9f% zu|86ONP&x4@9xZcY=3;dy#v4*Y}B9t#VVBQP=*SF=17bMkAxcXn_whE%b;?K3hg7Bm6le-|bD6{(C7ZNB)iBweB$I4rmYLZc zMFj5yFA6GN2;R4XG^AA!6)*62ZG{0YV=Dm6E|GxkKegEUV z2Od3gFMvygs6hoP6;!EMft3Pl$Mq>)%jnjq);BzEq&$I@yG+aUE)}S(-?X}n}C2Mm|;PMJ1_6WMIWOzEC! zTk^9p!~P4qZD&+-vyN$vjyU?HF>N~&8VCCVIYiqRHLo^hnMoUtD-h3P3os?+Ac1S@A0x6&k@J?p(rS$8xs10E z5|uj{rzlvb;#53NVE1t-7b#F+#jw;?U|W5e@B&0la_di1@pzmrpiJg1C(u})j$t8Z zs5ld~0;?rq`i-pZnx5^<3TWL?baIL#d^(jTG_Atfc!GjD73WCqZauEq0@Z1QR4@{m zjDjZ$oEbIUusqY7^%ss|6X!?{*GgK)u$k^6H*rtw7OT0w?OSy--tzgcXU_p3Yv$jNK{{XeKkpr@cYX%y79#jINQ& zIntzE`Eg`;E7}yat9UXx1nQ!8Veuq^6Gjb-(Z(|d>{ z-Bj9FGLRS#Stb}8Loc^nvNmi8DPfO_%cO*A`Oy~;LsDRkCgY*(bG2*C^tF-`gDUo7 zA5AxEc%AgaIQ_6hj&7UOsKFJuQo()|PsP&&TFP>I$GAF2eiUL_f4*4?ZIxV4z>Toe z{?PhGS{(P99iEp>=A-MvwVPrX;)W%1-k9x}2mGKPXY$ci3?n6Q>ZCqlFyb;D>@&SF zzPX-md5p#j2pjA{*jPbV4GfGZ7*#PQ&DHh)gU;kPX6Q@})fmTwf{cnukZos2Eipy| zXgx;S)CXp>bhovMJ$t%4TM`4EeZ50n$v$$YE;3jyoXFibkX3Ot=;y0aGCNvcUZNA7 zh!)K+GpvXCvi#oFz(Y>Kl!|H02yBT`d`UtJf<1#l)^J8_XHsAy8v2r{i>OnkF8zkf z)R{=hdcvgv58xUF&roqKo+*$h3$x>kD0z<**rR)?F~2TYNlJP-QnIz&tQp8l`t$Pm z3gQUxdOSB??>_ZJEdB!3*Fr%D$33sB1LSlK-z(aSL9q>@#Z}DoR!>$%E0|>YSNTv4?!mnZJ|fZGM*$^t zvfL0jslF==D5ycM$H!EBT&`GSy1lm7Zs#nn_6g!*t2StUip{#lNyByZQ6mn4&&ag? z0CQbP;LM8+M{Qgf_OCWYta$i^$cfbGNX;_sR=SyOY5FKY+C8yu$v#w=~XRu znp9iUZCXZeZgQAKolbPD*1GMKp4qEArfdhDRo<9MxZ5KOUKx~@Jq>fI6+DU#@|0Qa z7oYj^{%l|I@f^?H+ITK&6187RHXF>QMw^}*?zBm+ZBzWmYXxmzM;KXW2O~ z0%nNQ0v9Zv)0t=XvF7bqJdX(5W=!t8pS^U0q@8n8 zM!PAAaH=$`jPm)tl?G~*CS?+iX02^|nqTfnLde^Uq<_=V%>KZ-=SNQT=Y&|^YC4{2 zxPF3}k(*MT%IL1!;}iDM#~`Avr7)ku)+O2p+WLpu5-lA=18vEHp`NyZj=olI;_{LU z3dvev%Gl%BBeal9VO0`4O(}JBJ>CuV7(4@{-8C!m+ZsHK-zoULj23@jv?$S$F^thm z%SQ;R$#X$_-q{6i2?v#6U|whk>kqEV3frE@WsiQkUNBLX))B)aGvgAFEqW%Cqp8w zd{)T2pe230N?6kOIedOeA1|YP89cuGPaeYkC+|!6RQS(ZP0soP-!wjj>}j|g;tsx4 z;EVi~pMmxG5`QH)Ipxdv3ZKAN`L)8I{Gk5^OgA*#1!W#5%;BU%SkK0W!#GQz;X~MX zMZ7-V5Z`h)8V})IIc@|0&pnI_DsUe*vdhv=J48l|7}5kyuR4=rb1UkvFj~`F4`hL zabL+CjieN?8=H9hq>(h|@%;j{@V6BMXhR0=xQ;hV2hoAs&>7n0+XJ(Flk=;n_P2_( z{0@77?-tE+e_)ma$2LpfGG=*Olv&;xD0ZT_X&&z`C>Ot@pzj9@T_Jt*+uuWdd#P_9 z_3fd)d#LYa)VCiKNMe?6B{m;8hMwOm>N(0cx&2$0(R1NWAM#ZSL0d=10XcXYZ?87+ zS&J*N1^Yu#wjKk@_lrnE_%!6GX3PEM<>M1k%YLvK#2G!1CDGyf=>g5?$BoB z{bH0zO*HWGY8#oco$ov75eZ&m4Z`A^P2b4kMxJj=;o@Lm2L(6ahxid05$z#W_%Urz zfuHz(vwX><9}}8A^ZZrt9!kl+Z};UXva!L^717E8NiH4Eko z@;#|aIaD6<0r{v@&a4()Kz31inVp`UK7IOhPyh4pUw;Fb!&VXzMB|7VXhXX|$ANWZ znI+5FGhc5X$f6Qxe{MUrdLa-^j}#I}@RE`hH7`F}<-?N96y0(HNrATP%hi?q6&Sb{ z$8`fY&>@iKUo*UE`W5L}hqhUfMc=d4iTUbSZ7RF8K{$c&mm8z1fQ=BNva7=tfT*y$0^0Phi0H_RIsH zQgJ=BmGn%VYqr9qmF+qehPDDD@2b3CDhb?b3|*CbcBGI*KkmgbVBkK!ZmLL?9hI^x zOXWj#5|o4$?8cyhhZqvLT8*%5l`2vomfq5EDWnaIV3Y)otdhM`&%KF2nEOZoIBsA< z117708=fyUkZE8NQvzLkQf)FZ$12NZ&n<^q4mBophSyrTZw)-cV*#TYVCh$%oCSs( z5kg5C02)L};i-XXO{Rln*4$E^NCGngDccFM%_v>x%)azw0?!2?(6i<{$}Y=-U9q=I zGV3_5vceio=X4z_hq@1TJ*Ic;dLPVfX*m^h*D5O4J29=AgPHY}du)4hXO?m=x;s?; zM$UF*-Y;)UZ^I%yspQ?Izv32zHwsySeM(2<^oXR~>e=3LS=xVh~GMCarc3#P7L_ z(CZF<;4WIrZ-suqt0sbNJh^|KV8|*n6C3M^o#LB1wO%>{_Xs)=gzCTpl6pvMD4_L- z;t{Y$tG`C;ZjDxFNUN7={z!tca|CmjCir9~Hr|rpC<%@cW}GTyNN|z_r~Vhg)fNQv zHG=P`bCd~prk>@3`m&UBeXMI;u~bl~$GrBG9rKKYW&$DuRmYlA*YTR6IP0n48~jAz zv$m|3ZLLMn*)Iou!4UHVTwu_}&jelnLeK~{m|Fy!0hJVY1=?>(^5=ID75wra5N9BS literal 0 HcmV?d00001 From 3390465e933c7dec709c4474da632c93021d1783 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:01:50 +0000 Subject: [PATCH 3/4] Add .gitignore and remove build artifacts Co-authored-by: yus04 <49590084+yus04@users.noreply.github.com> --- .gitignore | 38 + target/classes/application.properties | 29 - .../example/userapi/UserApiApplication.class | Bin 748 -> 0 bytes .../example/userapi/config/DataLoader.class | Bin 1308 -> 0 bytes .../userapi/controller/UserController.class | Bin 2944 -> 0 bytes .../example/userapi/dto/UserResponse.class | Bin 1468 -> 0 bytes .../com/example/userapi/entity/User.class | Bin 1976 -> 0 bytes .../exception/GlobalExceptionHandler.class | Bin 3468 -> 0 bytes .../exception/UserNotFoundException.class | Bin 941 -> 0 bytes .../userapi/repository/UserRepository.class | Bin 434 -> 0 bytes .../security/JwtAuthenticationFilter.class | Bin 3147 -> 0 bytes .../example/userapi/security/JwtUtil.class | Bin 3165 -> 0 bytes .../userapi/security/SecurityConfig.class | Bin 6484 -> 0 bytes .../example/userapi/util/TokenGenerator.class | Bin 1403 -> 0 bytes .../compile/default-compile/createdFiles.lst | 12 - .../compile/default-compile/inputFiles.lst | 12 - .../default-testCompile/createdFiles.lst | 3 - .../default-testCompile/inputFiles.lst | 3 - ...example.userapi.UserApiApplicationTest.xml | 392 ---- ....userapi.controller.UserControllerTest.xml | 1724 ----------------- ...m.example.userapi.security.JwtUtilTest.xml | 1724 ----------------- ...example.userapi.UserApiApplicationTest.txt | 116 -- ....userapi.controller.UserControllerTest.txt | 564 ------ ...m.example.userapi.security.JwtUtilTest.txt | 564 ------ .../test-classes/application-test.properties | 22 - .../userapi/UserApiApplicationTest.class | Bin 622 -> 0 bytes .../controller/UserControllerTest.class | Bin 6811 -> 0 bytes .../userapi/security/JwtUtilTest.class | Bin 2338 -> 0 bytes 28 files changed, 38 insertions(+), 5165 deletions(-) create mode 100644 .gitignore delete mode 100644 target/classes/application.properties delete mode 100644 target/classes/com/example/userapi/UserApiApplication.class delete mode 100644 target/classes/com/example/userapi/config/DataLoader.class delete mode 100644 target/classes/com/example/userapi/controller/UserController.class delete mode 100644 target/classes/com/example/userapi/dto/UserResponse.class delete mode 100644 target/classes/com/example/userapi/entity/User.class delete mode 100644 target/classes/com/example/userapi/exception/GlobalExceptionHandler.class delete mode 100644 target/classes/com/example/userapi/exception/UserNotFoundException.class delete mode 100644 target/classes/com/example/userapi/repository/UserRepository.class delete mode 100644 target/classes/com/example/userapi/security/JwtAuthenticationFilter.class delete mode 100644 target/classes/com/example/userapi/security/JwtUtil.class delete mode 100644 target/classes/com/example/userapi/security/SecurityConfig.class delete mode 100644 target/classes/com/example/userapi/util/TokenGenerator.class delete mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst delete mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst delete mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst delete mode 100644 target/surefire-reports/TEST-com.example.userapi.UserApiApplicationTest.xml delete mode 100644 target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml delete mode 100644 target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml delete mode 100644 target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt delete mode 100644 target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt delete mode 100644 target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt delete mode 100644 target/test-classes/application-test.properties delete mode 100644 target/test-classes/com/example/userapi/UserApiApplicationTest.class delete mode 100644 target/test-classes/com/example/userapi/controller/UserControllerTest.class delete mode 100644 target/test-classes/com/example/userapi/security/JwtUtilTest.class diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43a564b --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +# IDEs +.idea/ +*.iws +*.iml +*.ipr +.vscode/ +.classpath +.project +.settings/ + +# OS +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Logs +*.log + +# Other +.env +.env.local +.env.*.local \ No newline at end of file diff --git a/target/classes/application.properties b/target/classes/application.properties deleted file mode 100644 index fa78775..0000000 --- a/target/classes/application.properties +++ /dev/null @@ -1,29 +0,0 @@ -# Server Configuration -server.port=8080 - -# Database Configuration (H2 for testing) -spring.datasource.url=jdbc:h2:mem:testdb -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password= - -# JPA Configuration -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true - -# Disable automatic SQL script execution -spring.sql.init.mode=never - -# H2 Console (for testing) -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console - -# JWT Configuration -jwt.secret=mySecretKey12345678901234567890123456789012345678901234567890 -jwt.expiration=86400000 - -# Logging -logging.level.com.example.userapi=DEBUG -logging.level.org.springframework.security=DEBUG \ No newline at end of file diff --git a/target/classes/com/example/userapi/UserApiApplication.class b/target/classes/com/example/userapi/UserApiApplication.class deleted file mode 100644 index 9935c9b5c31c0910e9f9c737f4ba9af2571618ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 748 zcma)4OHbQC5dJnKIHcjxP@udHTu{iNd*c#{1d)0&P&E(^oYrPB3-+$HUITxtr&c}m z2lPiFW?iI2A_pvaM)Ue+_M7?l{O2!#uh?#(hM55MHX4{^Sh^Drf~P_!{4BbYv16D$ zP+GY|hMDf(C_s~8H#QlUPa?}x$;(1okt=>d`Y2aNd7i3RIAwGTEqn;jZetz`3_W8L zUgTEkSasK5Ou@xJcCpeMgMBTGjtxTzZXtJj*WKm$?<{F zH!3Nuh*CMxg4{mbXQ&U%wPaWfm6oSv7D;>Va~V3JiA6dRR(bo?S$DUpVCaVL-O6^o8 zN2*Z%=~^3Ct%V>Cr!rRULX^%Bbrogubu-7bqzUT!*g-&N}M5TBI(1Rl8+?Y{}a%`GFfx@gcSnu#rqW)(Ch@g-J82|tP diff --git a/target/classes/com/example/userapi/config/DataLoader.class b/target/classes/com/example/userapi/config/DataLoader.class deleted file mode 100644 index 570a8f72bf0988f24271a7410521fe8f5aa3efdf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1308 zcmb7E*-leI82+XOT1wdto45fgOHnxPf<>eOjGBU`g&O14a5|KMcBVOJ%5v#Dc;&56 zU}8eh#0T(|OpO1Orj*bNz3BYs-@bqEuRq^^0(gd03?YOgXo;g0Z45oTe4o2Tt_tp( ztzF?6hPDN%q*-JLPbG5gh@w4$SR5UQGmLw>G+ic1W=-11AcdS?kDipvC^T3LIw9z!3l+AdyWn4e0Y z^)YLFsS3$|ktA}q&XG7qF~-mm@O{BB(Fk@rlw_g-ttN`%CPO?U3Y8-FYdMe8KyByG zr#wl}o7vS&6bXj*4H1}{`E4>c#5S5oFvBpd{el~mZ5`V_FNp)~@3~uA8+TckN?hgB zQi)7ODLd<7`Y^I2ax#!xMUhfU8*Zdl0mEFnDU#qSaJRWZ9}bBN?XF;-~`X$q_xM3Iqpl#*Mu!*M^e1WrfYU#K?y$WR}{nG)Q5)7)+U$8 zQFQJX2(Pb+nxQjmxVN{)%eCOK)k9B|t0hOUKwf9dP}fka*M!;8`M2D5)Ciy8V_9AC zJ@G=?y1LH}Xx0MI7@Br3AYY-)QCZk&l(nKYPGXD>H3Wt`^b6TzB|1wd-$v9WYISt+ z^xh@TCCZ4lP9KAPt*Yrxa)7(KlL1It7=Xe1bK5R?TktE!PDqqj8Fe`&aSz9wb-TPfmpYPKB&wtPV0&pEs5e4jV(B+~VJq)FX z;<4bq2v+&M+C%9XhMsFGQ04~1p7Qu|A9~T}py;9>F2fm5H@SQwnxQXw63a-0ihDXR zk@kHV@%ywiwK-+jYh@N>sAFYxw86luc^0BgiPXZDLZu&jvCl!t#oHLz!T*lh481EV zsNdX}sWX(z)mQgg8E-8mM)~|+Xp|0wUl|~x4!C#+2Z@4JNsREUYE=iT9f~VS;8|6^ zn1rFPWK=2QT?{!mYJ)}b04YqM+!c=i^l;Kz& znKCfSY@|dwILeDY*i@1V{rQ#aH{w#!6(k(L#EhL1qDVJ5OYQCHd z0&RrNzL?=kF2I@;LCjZ#XA6*vO$9!g7`?6{S+6j3P3bxXa$i*iaxQ7sWV9s6Jmo-D zd%|B9k+SplVwY(s@|R!BJ9Yzd(@%L|TSTiOE8BONyMvrCk*$KF6fI?vA?1j+Vp|Tw zaBic?)CQU8joPtiIGHQ{YL$>qX;zwsuFngbMMg%%L*JrW4TMP|;>&yUJzd)!gc}6n zVlGeXvc_xF@3KL@Bh9P`LtBtk*pG#u5Xf%+ldAvBa5dLVEWISM9YlDZjAI_A{nhaK zNK(o)bfkWimWYOkZTXhRCU4Eo%#DpRjC3aFCPy7vdMVdw9`<=*8ZR@C93JpRvsM?Q znH(BD$8aZy@i!SRQz4D`x8?BZW z6}dfTZC+Ehm2PTnVnZiyD-+{=J@~$eA0QmmTzH_e7}+}MRPb1@NnTC4BMs5+1XPTa zzgx3^voyAqS`O}tpzh0fw5s)55>_%5x4j{EC@yV;GAq9OKU*$eubVxa+Lot;?=LDN zDIFZ#T(w#=RSjHD6P_MsCr`MY$j5`wqbl>qs9Lv~2z;I$4@p&9N2pNvP zUX<=(Ey6KOa0_%Np_XSaVKiQ+Sr3gjXxu|1-Q?)~G0ixQjK=PXXJEh4M**ME+x`u@ zNlnt*8Xy7O#1xGTw=hjJtNaVebQ^ z1U=*QoPGvAcjga#@GI%He2oxX;2=sEq~8z@;}DM1MQD`1%5?m5npqqZEnjUMm|D#>><5&&lDDPS(;V35Aw-qPD7rvv2lE1Hwfw&QQ`EzK>j V-;sHVRXl`GD@9sqLgNvJ{s;9HVov}7 diff --git a/target/classes/com/example/userapi/dto/UserResponse.class b/target/classes/com/example/userapi/dto/UserResponse.class deleted file mode 100644 index ac87eae0ddd5a8e29f71648a0f8daddefda6201c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1468 zcma)*T~8B16o%g^yDii$rR77ZqJp690&Xdpz=X~s+zrTJ1c!jMp3YaRva$uvVFn8vE_Pw4zIPu;e zpXpAlP<$B-f_PV9s@Xc4!8B${C_A_XM`67a_C5W@@1OUycQMqFe;#<#a!&uW;?rQL@VI>w`W=P6W(LckXU-|+ zP5x;eu?p{Wd>VE?_z@G1bwm#PM8|t9P`%m8sF-(nIZQ6+|6>rf5<~Y*Hnu z1iPCfl-#WmD(?0OHFwz>VPUM;pr&Y9s9*-O{8eSH_(ILR@*+`6U!kT+Lns<15lOCL zBBsnvlCiMDea)gP=mcJaqbZR0@qp{q41b{Xjh6+CGhEEg@FB~YWVlN!FBeUA<80*1 z1!HY8NsX2gFP@}EQa@>eGJLi&d7PO~muX>=X*-vxmCux!#H4r6$n^Xg QCYh~ErevO6k`=J|4=<MsbnF3`gC#d((JTVQ+v=5AT`-ifk z1?5(ht@N6p^vrCzo!Y29PaOs7q=KOFic>S>H?wwZNyGP~YaS~@+FI#T<0C{t8QZK$ zLH*koz#p`$?1N>7>Ml?Z<78#cR2FOc3e?Y|0ND z-Ld?d%{*-1vP{&M#@I;ESYy?kyP@(sFcCP z?Mru$lk)tWifNTiSFs!^Gy01{mnXL`*#e|lngOBn&59P_Dw^3chW=LSFHZHn>0*^M z28n$+ka`RI&_BaHKF5tVBI||5VtvlQ#%Otj?gTqI&=4Gvf&;=shiml!k)0vh01@<$ z_apvf;9V?jh!B2td~kfXB3~<3xATjbXS%J%y&1e5v}+_DU;Q=&ZHG0>FU_M#yp9yM zA%hc71Y2<(QXixt+{2J>NE)G0DDYTuvbhKM819=ekAJ2Kpb&6Gkpgv!-(%!DL}|JO zYv`T|-KRd&bP&@`Da61YN8;UHElCG*<8OoWHsB510(Z9bi^LCnr05P#HgoQ~I18Zz z&Co0)4lcoqgDu<{+yfk3x_3tT()}~)D$Siy?*-N%B8bM}IYI4U-wobHnhLN>VSI!Q zq@Y=xdm!ose{pSTx(97n8V=k?f|AMHr#YOBmHedQcNps{xtmzYJjxF%S;NiK%yAXP z3-0`bCS=Yc5%*#+^osfBqS-UItbo9r9?-)CPWfg|Mk1$2w16C3Py?rYGp7Y`dfb8& zFPsSa1y0;A0oNo>UCo>p6FEIe=G4{9X&IbWT5#gcjyduC1U*gU)Z5JIMIxugWKMN^ i7tU@SoHkl;;=PJF@jj*KS#U1Juk|_PWjJ+uwDKPrvRL~7 diff --git a/target/classes/com/example/userapi/exception/GlobalExceptionHandler.class b/target/classes/com/example/userapi/exception/GlobalExceptionHandler.class deleted file mode 100644 index e5e11208821614b112ddd1e5faf6897fa9bc96da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3468 zcmcguZC4XV6n=)c4PjNJDxy^pQG=pet5|E0Hjp5xkXYWV+EypKlQ6j1&Dj@_{*iv_ z=YHy`?FXgpIsF0sQ9Zr0Nibldk#lNtcC&N$&YkDE_nDjd=ifj725<+JI6Ba&p-V?M zdKmiG`35&^?v#vtVO^L3L(imiWH80hnHXEu5MwwTIfa3=jXCbGEpUpWp)-a)hTcGy zg&*)T*$&{KhC@2~ahPE+nxx(u^RCJ5G!MiwjVP|;ZZe!qjLo-jN%r9*9MN!8$1w~t z9C*DxtxW+cA>q80sLpQypM29&Tcpt`h9P1}n1j&o#Yudu;gpWkIKyzx^-6|c@uX8K zdb}()UGJH(76cVzj&4iQ6yluAFF%>hujJAU=jYp)l8nWPl9W}QHkgvX#o?)f6au|&3!P0b@2!(|F8JkRxFxT4Ux!SJjbI#vt@ z&8PDCyd>hdhEFwI*Kq?A4A)J!Y>4MnH(MB?FFan6G&V&gkgj8_kcHwzVKQ|qL%bw{ zg=##8BlQYKfR_T5HDdZ1ZfW>j#}IBaTx^-0Md4Rm#}^qVkiizi(?mO&oN+CY9Bb{l zJL>4PYi&)3(zb+0qMF1V4O2S4z?YPOHjy>PVCX7PM20&}wAVJOq!QhA@X>wKH;Ubr|ur%Cfxbb!++_l{Tw|6u!#~sU7 zy6jS=U^p}{9gz#m1>r68f=!lzXuGd+PpWav*cGfvpW){Geilnow^)nTZ6Qn2&fDWQ zo!7pO2tbE;&M>jBWvGEgyR)uMm9$+Qjlv(>owTh=J#iDeT_+nlTy4iSSgI{NIYj~c z7X%5wy3bV`3xr3>?_H85hnk*8Mf&l7&R7j+^q)aJyG_^%_|RfVGA)Z$=}Xd2%5hw3 zyGrv6x0`PKO;Iok(yAwfw}+covQBBX>QGUg1T5Bx$QTkx$-XjyV{h|BF=jyJoAo(x3?n0 z&mS22{)-S_azoD)v((~A_RSmkRn>tQrkWO-i!`m3GTP_WZ*B`H5 zeu+=219IEOO?s2;zzYi389_KfAV7!D7>>~QC@#<$JPpGjar;(A9yb;PiWtoC43(uR!(tPLDo6=y zZ8MzP%kbW7h6{Cub1fN;5yMNw@G>zRCx%yuq0y3|d|!s^O&Ch5+Ow#_cJx;1xlCh+ Ot~fnU($U!M>HQDS1Lhh4 diff --git a/target/classes/com/example/userapi/exception/UserNotFoundException.class b/target/classes/com/example/userapi/exception/UserNotFoundException.class deleted file mode 100644 index 000b547c1effa99259767d0fc1083a6fd04c7ba2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 941 zcmbVL&2G~`5dPLAahe8FTH2BT#Xt%aBz!0X)aORT5Sk7f@r^jQCs(weq?7B+ZO= zso~0`4E_7w0YBt!$ko2NP=2uz_!tBV+k#W-kHaTOc@!8S4X~xjns;v z@k}adUNEdznMDw^WLKM!&QwrgUaJxop-vcT zLmdc)jwhAa&7!GD_V_d;WYyC?4<|g4xn6=bGn16{6YoDF7%*5eU|6XX=rjz1-U>6* z!F!(YNEngO6|J$(5?_pD9!qawN{{k7lJiTgO=_qJ1xwm#px44RT(@x}Z{QZS>8#{Z z9qPGoi;5OK9dY02l9hv8TnF=)bJ=;l>$ls3+nytU3(8bwD2PaVe4exsB~h9OT=k=nS!u>Duc zi!!mX&9L=vQyR)5ZQQ~#jdK1ldY5n!7A}!CBx#Xce(>;w4)6o@@1$Dj(AqjZs*`MB xh4hWW6qk|zV&sH1Tp_P@+SeH=pq_2eYGD&sNjB-QOW#epKc{23jXv(8`v<(w2UGw6 diff --git a/target/classes/com/example/userapi/repository/UserRepository.class b/target/classes/com/example/userapi/repository/UserRepository.class deleted file mode 100644 index 8032031a6c5ca03041b32f1013dfd6490a8e5e79..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 434 zcmbV}!Ab)$5QhI$?b@m!c=8!UbMmw*c<~?$LW|y~>lm``W6V<)SF?ueRA8uZEWzmLgLUREP{)rF?)5Dt(v7EO;-#krP+>H+#!>16D?C?!(Pi~7 z>`ArC7Q1BAx21AvQYFrmXQje;Dt)N=!nRq<-f!nepUM>WCw+!=d}E`XwS4ZJBuZ9X rR5)0vH6{)$Y3^AsY?t}N6xMQVGPTp}of83h4xO-wOUKtoUW*j>Yb*_R&? ze@4#9aXlv=^C7<}CnvXhW{`n#Ip)JuSJk}t>b?7Jy;pz#`}|J;XYp$aO=z}|u+f56 zf#X3q=S0QO_2*_oSy1I5Ty)B6#+h|JtwLwa@0PN)YZ73tx4Q=s*X>%01#Kyy#; zbP`E{_6sFFAB65hsolVDLkevcY#Z&^EO2l^F3M0#CsN^(r?fM#bPP#JtjxniTn+^>yre-VNh5V=(BOi2y{?jBJf`RY2k>#SR?+d zhAZo0b!zsFbgReE33qs`>%cL72opcSg<~@d6s!?FRyI=1_hDQx zrw7|z!amm84jmsDjIR9p_a{;kk*3M*=#)QPIM*=Uts3|g| zx@COp&Azk6OdGD?3kz8rS8+|C|D7!fY>m{qyC!h5=Pi7zXC(n^!#J*6n6NR4DS=(< zt6Aj^56w&07f9xV+MT{=(o|pg>g!$R)&ECDQbqA_f%HU)<)Wab-N>Es)CJ!UbX+?~ zrPB@LnNiY@oLQOELAc_`RRxEk1!Xr>`HVnfD9H0VY{|O5x>hR8sBlWsyg+9*$VqQn zhOSvxHxqi^<$0&xSe)w7t3biiI%=?tk~%ChEOgOEcwW&LHsZ8VunO1)MAsxIMl)$@ zvMF*V(Dm)Xz!I{?32Zh6=4F`{xZV)y|5539R*N=OnB6O^v{wOBn(7&|G19mbQ#%=| zO3(s*Z=qHNh~;oL?&4Lx?%ANa7BTiq14OMQw@+%BTf8cZRaT@fE$37*E^8JTNY{Gr zt9)M-vrrV+7Q^la&gj_cA7sc?#gd*Mm*yElj*xAs$)FVG6dhtlcE6%`9yQhs1PyBi z4XHq{6ctNwfp>~2HEbLV0?oEAi1vfp;yXUnCdRUt?h65X)c4r|J$7CdS@=<4|4V=BPOo>{!p{PGUoXmIDluXo-$G4n zrGg`0L;T+0s+Heqew+B^qm$!Jt{i>^zb$=FAbyYkzQxh}4L0xF9PNq#?%*z03Eab% zXg12?AS`U+Uina`^$eSuFpx+m{=!T;(YfU@wm!nGbfUw0jGY55eSctAy5%wUJ;G3J zeqf-rHtij-Uf}TUbgOuQqqo!4IrbbUfG7CuDF&Y4^MT}345gFLFxrG8hYml(STl^f z%`omBMH|OmeDChzgK;k(R9)QLhknj3q8r!wy2|qbNe2#YmSi50}2AP{0B;5?G{865=2D7Gdq;U5JUuDfMP{ZD-Wyo6^6?Ym`SEdMwnV#`+nEH zeuf{~wYpT=)vkW-kLv2anRI4=@gd73lY7rO`|h*PIr-<`-~R$|3O~mYK~zIbM+LSC z>|8c)n?}mClg5?#Wts2=ww<(W%Rem;ZEK&a#CB9_i0i0=E^s*Eqz$=drZXvNWIgGc z8O!iwBI{ay&X`#BXMHOrP`SM7Ps@ZW>8^IN7-HIYEju|JM-6sp*s0?M)Na6#-ypC( zDgDu$FFk=+Tl=liIO?!l!yX+kVy{4x&Ccr?X*Zd)l_<;;E6gqn}4`os?8D z2Xq|Apg=_;Wm;*0(K7Bz0_62H{L}!-?U0UPoD`@c)Qg^%l?x-3O?T+LkdkLRI<4c3 za#T%6#f-$6s}UWe7~=}FIBg|uijbKnbtGCPzKkjqvhzB|ae->|Xmj22mjrr4SOv{1 z1wHeK7j;bF5>w3b$(X9h>cYtR(ks+O8>Vzz#uY-%m@exp%sDHsye6)e?xHeY#WfAn zI%Y5{&|F3t8w~PXl`?YtxzD%3Q4smMj@NL5`Ur%~Dt#JcTHM0x8s5< z=tb8|%T>o+G3KRdd&VLq>$o|?EEpJbW-2R(nd{r?L7?mK9rnR)mIa&sP&!v=uf0e6 z`i~79A3V`he7eiZ%kP(k#yK=N(BGr}aWOXLEYRnUNz0a(v*~&1&X~ljW{Hz9Q*)+k zso&wtn7?H404s1azBEN0nuRyoS@ zhQ+2uRRm|usj0&CDd{gc3#=U)`O+osI?7`{@|bhvlR z?8r-%N8ia<*VxTV;#4z%)d#1T4 z%gqL4X4=WR2{~@5)asPe$rxFb=ZANBDIU;UB+J zAmH&=74JU(XFc5J0%!Hsg;i|hOMVFPx<(s=cfor_$0LYe1D82o)iUV#-QXH*z#Y67 ztaGk}#>YbAs*c~FJw)|m?D{3xQgpGq#6?x;Lf|gmCqNbdPll@C{lXupzwrqBE~|Uj zLp0K5v-t>zhhmS>dSo445!Ci|uH#q~UF$dzL49l;ry}Thh_mZB7r{DS5h#Z5K%8#t zNmK*>8u?Argce>qaR7a2#tD)*LXO6{rcT+PhY>;~Abb!ItDgG#6rraxxQ7oBrN1tG z#HScOre$S>Ta^Qlj!*Duc(NStQNC+^jLAI6s|w_t08evMJ-#jQHx{ROD2~}8@&-}@ zVvV7daobRfc76kP5OZgMv^np#fV35#1xTBr;d6Y!unJX$;A@5G%L1Z%G*pPXpNXip zueN3#D^cRB*$k|Qzehf-X)x}T1e^vt?^#A|> diff --git a/target/classes/com/example/userapi/security/SecurityConfig.class b/target/classes/com/example/userapi/security/SecurityConfig.class deleted file mode 100644 index 020be66d4acde2d6644db94648e8d38b3242f3fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6484 zcmcgx`F|V575`3rtgUPuMF|0Omc$fWA#BJ2v`Rv3Vb@9I#I+o|3Fk-}TWha&#qP?E z!`T$dP3e6@OD~QdK&jH20)Zd-^l$2?Z+2JF+ELev?N2`WShG7j?|$=rZzf;Ft|H5LJhYPQ(~G^A*Rn zO8Pm$u(!7_W7*T1Q?_+;ddlV{F>l$knj`WRTXz?*SJac*QMRHaS$Yotbz0i7ScI^Pb~|bi)-k!`+!kM#mb{ zr4)RHVLUQcGBVPVx=ig9>1k3}JyeKqMNjhtXik;|T*vtzBU(o?EW!aQqmEOz@ zpXIj8$yj^N5U%DgNYQ*PWzz=nPpxYdTl^5+uA*0lNGS>~Gfpa-RIv+pFtmAT$gqv} zKwTGq`;foxWZ1u=ziM&wZAurpZYIzwW#5Ip3ihekj{^*&k&J>pwk$vW*^2G$6JL8j zJLD9D>TTAOWx1&whG(zNrioOFpy3|etKe%YzK#?_e!Z>k8Ik}M*z7xlA?C`Hu1xp0W#V5Bi}?^Imf&`R9R7lo|_C@|u`D!7j!ePtZ_O?Q;L#ifio(9f_* zlh`3K#L<$;7!D&X%fS7FL~^&)c2(Aun4apJh+zodP%y0GD2_3_7^#OJVJ*Tz5(F+o zyLxK&)V_PL<-?}E)QT}Ntvjy0K!9QUXc_p45;@!ZKs5ZX;A(=Ax(hCC<_v>zmCP1} zQ?}8869h2*_m3Ps5yNqes`w_xBn)w9%rXcU-)t1AXv42&WKta%XXw(3dv}vqhg9}5 z?Kmb>OyXPAM3jYH(%pW;V0d-yo355KODgE9a*9A`2xnA0AR#`+&4nQKWEdV&@vu~W z6R(#!QRu{@;0kgo@+dGIZYEEPROq#=-x;KB;idYhW$1az>CWtU|M*~LFq>sK(o{(Q zKR2>w3eyUTDs;>+oM}e6h`k%ATyJLTJ|^@CTAk$vz0q84iLhc-rQOeWzW_$)O)fG} zQedjEP-Yleql?nigoeGM6m*B@g`HmLU(lH-hZh> zCJel{Vb^29&28=MSeW3ZhAP^QkJf*B%kh zjW;A*0iA2W<1x_&OC3Fud#&IGfw?%NTxzUn_V+#hdsI!;X5n(9Jn(R%jUy=81v_Rh&vG=~93D zPxw?25cvXzxmhrT)045R*-ANlc@iA+LZ_Z3gyRck5nkT>M_*(#ZTPSia87f>$m*_0 z#qrj%6KQZ9>zg2N{XRzbV}DTbJ-i;r>ooDUoOnmY%XlS@S7_qTa^f#4p2rJuyg(E0 z%ZU$Ed>iNEI8PHF$%%iccoxsa@f_WW95qd0d$&n~%5dWH>jDLf3=cO--zKwAp1D`R zLxyB+MKed>O|`||!BN4d47XjDIgOG)!9|9fqnFY(u%9uwm0Yz!CNKTcg(QuS(OWx> zHjN66bdgNI4!vnKG8)^G7r;KChYfJ)SAGVzphCZ@zW{TXr#FVPSfG0^N&F;QJV6I` zEfQN)v2l@TXiO~P8aZxHeuVDCEmhn)NlR{%Q(v9jRYl)L?0%mZ_`3$3S+ld|6O%zgr?Y@ve0pI}6;c-&r3HsJbZ?7a0PQ*iLd|G}g`DNSBJ=@mNvj1+4baC|R{9tGGMF#dq4y5Oq7< z34Yh3rpykg=e!62N0P0d;Na<&k8${P;>ZOIWUCmwh~tToDo%zzW$T}+I90`IT2sY? zA-VDz5)|nzxB++IM)J>1Asvq3MZDzcK-(?QVPD{k&g6%9qzVyY<{Qx+V$g|K@tVhg zHgLco?1I_LsILoAx6}U}e4o^7#SiFr1Agd5Xe&AVNA&(<`uhp-{OK9|3_qur{gj)( zppU=B@9@Xq=}&k!czO?i4W9mn4}+(_Q!FnKqkJI>XV*d#~ I!{_M!AGIA*3;+NC diff --git a/target/classes/com/example/userapi/util/TokenGenerator.class b/target/classes/com/example/userapi/util/TokenGenerator.class deleted file mode 100644 index fb938c092120abaeb4b98075c0213f6e81d63f2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1403 zcma)6%W@M(6g_QA9!U%VBrrA!!MrU6d&m=lFhLkYLCMC2u{NyQQd_jqbgM=^*k1A} zd_t&{Q=>5(vTSqm03x4ZAX=broM{^#Gn{sypwrzK2aGC(dw9#aCRcjP-6 z^`z-WFSd46+X+nF*G9Vs0+aLARuKgh1C&CXKqzptZR1Go$++KBQ94kG?CU6Xx);5& zZPOQztQG`W07I0c1-*~+G zY^{VcDgn-hIEQJ0YhMB@aI!ljr80&Bcjud*bKY=?Hr@L1lj`xK0%lk*pY&0F7X)&f z8!Io1_y!jPd>i5t=8jZ$V}IaO%!1mK^*uL));3yaa7PMC#!UZ;K-lo<&t**Sm2eH$ z1KbF46Y~Ov-7#3t#F@B=Ig)NIm?1|Foloyb`2 z+T?AtWvz>rZ5&I}X=p%^=#AZO+7g zBo7^;M(XUYPE@DP>Mh%j5;)~Ut)=mnN?u9A3zVC-Eqg7QXulsF=G+_2c-65}HD(kU zU@}Qrpy~P7$D3MhF}_T?M68Ta3zV{n9L-MoIDkOWkHpBJw6fP${j4Mbe*4t4?0Ow) zI2xqZggO$_u0f7a66aEFDjQEaBQQoHXIzA)( zf6rY+DJb)`KOuh4)Iad=)u8i_{CfZz;3xb{`5wRE4kk0_50p8cE!F-&P(E2cb$~Og z+4_8Wmg}{T__}=g09Pq*4aEVf{_wluZh_)+&?{sPz84`XnBjXdhiP7d^UP$1p=WU) z7cxS%VbBpF|3coyuOu0g)IHRh;S8?Rx=wmaM9fk501vs!bLJ@~(8&Ievci - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml b/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml deleted file mode 100644 index 01e2f1c..0000000 --- a/target/surefire-reports/TEST-com.example.userapi.controller.UserControllerTest.xml +++ /dev/null @@ -1,1724 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml b/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml deleted file mode 100644 index befec8f..0000000 --- a/target/surefire-reports/TEST-com.example.userapi.security.JwtUtilTest.xml +++ /dev/null @@ -1,1724 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt b/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt deleted file mode 100644 index 7bc094b..0000000 --- a/target/surefire-reports/com.example.userapi.UserApiApplicationTest.txt +++ /dev/null @@ -1,116 +0,0 @@ -------------------------------------------------------------------------------- -Test set: com.example.userapi.UserApiApplicationTest -------------------------------------------------------------------------------- -Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.052 s <<< FAILURE! - in com.example.userapi.UserApiApplicationTest -com.example.userapi.UserApiApplicationTest.contextLoads Time elapsed: 0.001 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@544630b7 testClass = com.example.userapi.UserApiApplicationTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - diff --git a/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt b/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt deleted file mode 100644 index 6c60149..0000000 --- a/target/surefire-reports/com.example.userapi.controller.UserControllerTest.txt +++ /dev/null @@ -1,564 +0,0 @@ -------------------------------------------------------------------------------- -Test set: com.example.userapi.controller.UserControllerTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.161 s <<< FAILURE! - in com.example.userapi.controller.UserControllerTest -com.example.userapi.controller.UserControllerTest.getUserById_WithNonExistentUserId_ShouldReturnNotFound Time elapsed: 0 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.controller.UserControllerTest.getUserById_WithNonAdminToken_ShouldReturnForbidden Time elapsed: 0.001 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.controller.UserControllerTest.getUserById_WithoutToken_ShouldReturnUnauthorized Time elapsed: 0.002 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.controller.UserControllerTest.getUserById_WithInvalidToken_ShouldReturnUnauthorized Time elapsed: 0 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.controller.UserControllerTest.getUserById_WithAdminToken_ShouldReturnUser Time elapsed: 0.001 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@37fbe4a8 testClass = com.example.userapi.controller.UserControllerTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - diff --git a/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt b/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt deleted file mode 100644 index b814c88..0000000 --- a/target/surefire-reports/com.example.userapi.security.JwtUtilTest.txt +++ /dev/null @@ -1,564 +0,0 @@ -------------------------------------------------------------------------------- -Test set: com.example.userapi.security.JwtUtilTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.72 s <<< FAILURE! - in com.example.userapi.security.JwtUtilTest -com.example.userapi.security.JwtUtilTest.getRoleFromToken_ShouldReturnCorrectRole Time elapsed: 0.008 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.security.JwtUtilTest.generateToken_ShouldCreateValidToken Time elapsed: 0 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.security.JwtUtilTest.validateToken_WithInvalidToken_ShouldReturnFalse Time elapsed: 0 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.security.JwtUtilTest.validateToken_WithEmptyToken_ShouldReturnFalse Time elapsed: 0.001 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - -com.example.userapi.security.JwtUtilTest.getUsernameFromToken_ShouldReturnCorrectUsername Time elapsed: 0.001 s <<< ERROR! -java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@6bab2585 testClass = com.example.userapi.security.JwtUtilTest, locations = [], classes = [com.example.userapi.UserApiApplication], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7161d8d1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@795509d9, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@35dab4eb, 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.WebDriverContextCustomizer@7c137fd5, org.springframework.boot.test.context.SpringBootTestAnnotation@d278800a], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:143) - 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.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles.active' imported from location 'class path resource [application-test.properties]' is invalid in a profile specific resource [origin: class path resource [application-test.properties] - 2:24] - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$1(InvalidConfigDataPropertyException.java:121) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1093) - at org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:118) - at org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) - at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment(ConfigDataEnvironment.java:328) - at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:235) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96) - at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109) - at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94) - at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) - at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) - at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133) - at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136) - at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81) - at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64) - at java.base/java.lang.Iterable.forEach(Iterable.java:75) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) - at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) - at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63) - at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360) - at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) - 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:1406) - 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:187) - at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:119) - ... 73 more - diff --git a/target/test-classes/application-test.properties b/target/test-classes/application-test.properties deleted file mode 100644 index b1e97ed..0000000 --- a/target/test-classes/application-test.properties +++ /dev/null @@ -1,22 +0,0 @@ -# Test Configuration -spring.profiles.active=test - -# Database Configuration (H2 for testing) -spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password= - -# JPA Configuration -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.show-sql=false -spring.h2.console.enabled=false - -# JWT Configuration -jwt.secret=testSecretKey12345678901234567890123456789012345678901234567890 -jwt.expiration=86400000 - -# Logging -logging.level.com.example.userapi=INFO -logging.level.org.springframework.security=WARN \ No newline at end of file diff --git a/target/test-classes/com/example/userapi/UserApiApplicationTest.class b/target/test-classes/com/example/userapi/UserApiApplicationTest.class deleted file mode 100644 index c0953ed566900bb423f05a69e8d1b5c4d4800570..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 622 zcma)3yG{c!5M1X8A&?MWLQqgbKv*<1Jfs7O>I8^{G*rHe6E@u0C!a6mx2TXP_y9f% zu|86ONP&x4@9xZcY=3;dy#v4*Y}B9t#VVBQP=*SF=17bMkAxcXn_whE%b;?K3hg7Bm6le-|bD6{(C7ZNB)iBweB$I4rmYLZc zMFj5yFA6GN2;R4XG^AA!6)*62ZG{0YV=Dm6E|GxkKegEUV z2Od3gFMvygs6hoP6;!EMft3Pl$Mq>)%jnjq);BzEq&$I@yG+aUE)}S(-?X}n}C2Mm|;PMJ1_6WMIWOzEC! zTk^9p!~P4qZD&+-vyN$vjyU?HF>N~&8VCCVIYiqRHLo^hnMoUtD-h3P3os?+Ac1S@A0x6&k@J?p(rS$8xs10E z5|uj{rzlvb;#53NVE1t-7b#F+#jw;?U|W5e@B&0la_di1@pzmrpiJg1C(u})j$t8Z zs5ld~0;?rq`i-pZnx5^<3TWL?baIL#d^(jTG_Atfc!GjD73WCqZauEq0@Z1QR4@{m zjDjZ$oEbIUusqY7^%ss|6X!?{*GgK)u$k^6H*rtw7OT0w?OSy--tzgcXU_p3Yv$jNK{{XeKkpr@cYX%y79#jINQ& zIntzE`Eg`;E7}yat9UXx1nQ!8Veuq^6Gjb-(Z(|d>{ z-Bj9FGLRS#Stb}8Loc^nvNmi8DPfO_%cO*A`Oy~;LsDRkCgY*(bG2*C^tF-`gDUo7 zA5AxEc%AgaIQ_6hj&7UOsKFJuQo()|PsP&&TFP>I$GAF2eiUL_f4*4?ZIxV4z>Toe z{?PhGS{(P99iEp>=A-MvwVPrX;)W%1-k9x}2mGKPXY$ci3?n6Q>ZCqlFyb;D>@&SF zzPX-md5p#j2pjA{*jPbV4GfGZ7*#PQ&DHh)gU;kPX6Q@})fmTwf{cnukZos2Eipy| zXgx;S)CXp>bhovMJ$t%4TM`4EeZ50n$v$$YE;3jyoXFibkX3Ot=;y0aGCNvcUZNA7 zh!)K+GpvXCvi#oFz(Y>Kl!|H02yBT`d`UtJf<1#l)^J8_XHsAy8v2r{i>OnkF8zkf z)R{=hdcvgv58xUF&roqKo+*$h3$x>kD0z<**rR)?F~2TYNlJP-QnIz&tQp8l`t$Pm z3gQUxdOSB??>_ZJEdB!3*Fr%D$33sB1LSlK-z(aSL9q>@#Z}DoR!>$%E0|>YSNTv4?!mnZJ|fZGM*$^t zvfL0jslF==D5ycM$H!EBT&`GSy1lm7Zs#nn_6g!*t2StUip{#lNyByZQ6mn4&&ag? z0CQbP;LM8+M{Qgf_OCWYta$i^$cfbGNX;_sR=SyOY5FKY+C8yu$v#w=~XRu znp9iUZCXZeZgQAKolbPD*1GMKp4qEArfdhDRo<9MxZ5KOUKx~@Jq>fI6+DU#@|0Qa z7oYj^{%l|I@f^?H+ITK&6187RHXF>QMw^}*?zBm+ZBzWmYXxmzM;KXW2O~ z0%nNQ0v9Zv)0t=XvF7bqJdX(5W=!t8pS^U0q@8n8 zM!PAAaH=$`jPm)tl?G~*CS?+iX02^|nqTfnLde^Uq<_=V%>KZ-=SNQT=Y&|^YC4{2 zxPF3}k(*MT%IL1!;}iDM#~`Avr7)ku)+O2p+WLpu5-lA=18vEHp`NyZj=olI;_{LU z3dvev%Gl%BBeal9VO0`4O(}JBJ>CuV7(4@{-8C!m+ZsHK-zoULj23@jv?$S$F^thm z%SQ;R$#X$_-q{6i2?v#6U|whk>kqEV3frE@WsiQkUNBLX))B)aGvgAFEqW%Cqp8w zd{)T2pe230N?6kOIedOeA1|YP89cuGPaeYkC+|!6RQS(ZP0soP-!wjj>}j|g;tsx4 z;EVi~pMmxG5`QH)Ipxdv3ZKAN`L)8I{Gk5^OgA*#1!W#5%;BU%SkK0W!#GQz;X~MX zMZ7-V5Z`h)8V})IIc@|0&pnI_DsUe*vdhv=J48l|7}5kyuR4=rb1UkvFj~`F4`hL zabL+CjieN?8=H9hq>(h|@%;j{@V6BMXhR0=xQ;hV2hoAs&>7n0+XJ(Flk=;n_P2_( z{0@77?-tE+e_)ma$2LpfGG=*Olv&;xD0ZT_X&&z`C>Ot@pzj9@T_Jt*+uuWdd#P_9 z_3fd)d#LYa)VCiKNMe?6B{m;8hMwOm>N(0cx&2$0(R1NWAM#ZSL0d=10XcXYZ?87+ zS&J*N1^Yu#wjKk@_lrnE_%!6GX3PEM<>M1k%YLvK#2G!1CDGyf=>g5?$BoB z{bH0zO*HWGY8#oco$ov75eZ&m4Z`A^P2b4kMxJj=;o@Lm2L(6ahxid05$z#W_%Urz zfuHz(vwX><9}}8A^ZZrt9!kl+Z};UXva!L^717E8NiH4Eko z@;#|aIaD6<0r{v@&a4()Kz31inVp`UK7IOhPyh4pUw;Fb!&VXzMB|7VXhXX|$ANWZ znI+5FGhc5X$f6Qxe{MUrdLa-^j}#I}@RE`hH7`F}<-?N96y0(HNrATP%hi?q6&Sb{ z$8`fY&>@iKUo*UE`W5L}hqhUfMc=d4iTUbSZ7RF8K{$c&mm8z1fQ=BNva7=tfT*y$0^0Phi0H_RIsH zQgJ=BmGn%VYqr9qmF+qehPDDD@2b3CDhb?b3|*CbcBGI*KkmgbVBkK!ZmLL?9hI^x zOXWj#5|o4$?8cyhhZqvLT8*%5l`2vomfq5EDWnaIV3Y)otdhM`&%KF2nEOZoIBsA< z117708=fyUkZE8NQvzLkQf)FZ$12NZ&n<^q4mBophSyrTZw)-cV*#TYVCh$%oCSs( z5kg5C02)L};i-XXO{Rln*4$E^NCGngDccFM%_v>x%)azw0?!2?(6i<{$}Y=-U9q=I zGV3_5vceio=X4z_hq@1TJ*Ic;dLPVfX*m^h*D5O4J29=AgPHY}du)4hXO?m=x;s?; zM$UF*-Y;)UZ^I%yspQ?Izv32zHwsySeM(2<^oXR~>e=3LS=xVh~GMCarc3#P7L_ z(CZF<;4WIrZ-suqt0sbNJh^|KV8|*n6C3M^o#LB1wO%>{_Xs)=gzCTpl6pvMD4_L- z;t{Y$tG`C;ZjDxFNUN7={z!tca|CmjCir9~Hr|rpC<%@cW}GTyNN|z_r~Vhg)fNQv zHG=P`bCd~prk>@3`m&UBeXMI;u~bl~$GrBG9rKKYW&$DuRmYlA*YTR6IP0n48~jAz zv$m|3ZLLMn*)Iou!4UHVTwu_}&jelnLeK~{m|Fy!0hJVY1=?>(^5=ID75wra5N9BS From 0b3a26fe79fff2f081bdb808a917fa921979a43a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:02:34 +0000 Subject: [PATCH 4/4] Add comprehensive README with API documentation Co-authored-by: yus04 <49590084+yus04@users.noreply.github.com> --- README.md | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6bbd59..5c1d531 100644 --- a/README.md +++ b/README.md @@ -1 +1,104 @@ -# coding-agent-output-comparison \ No newline at end of file +# User Management REST API + +REST API for user management with JWT authentication based on the provided specifications. + +## Features + +- **Endpoint:** `GET /api/users/{id}` +- **Authentication:** JWT token required +- **Authorization:** Admin role only +- **Response:** JSON with user data (id, name, email, role) +- **Error Handling:** Proper HTTP status codes (200, 401, 403, 404) + +## Technical Stack + +- **Framework:** Spring Boot 3.1.5 +- **Java Version:** 17 +- **Security:** JWT tokens with HMAC-SHA384 signing +- **Database:** H2 in-memory +- **ORM:** JPA/Hibernate + +## Quick Start + +### 1. Build and Run + +```bash +# Build and run the application +mvn spring-boot:run +``` + +The API will start on `http://localhost:8080` + +### 2. Generate JWT Tokens + +```bash +# Generate test tokens +mvn spring-boot:run -Dspring-boot.run.profiles=token-gen +``` + +This will output admin and user tokens for testing. + +### 3. Test API Endpoints + +```bash +# Test with admin token (replace {admin-token} with actual token) +curl -H "Authorization: Bearer {admin-token}" http://localhost:8080/api/users/1 + +# Test without token (should return 403) +curl http://localhost:8080/api/users/1 + +# Test with non-existent user (should return 404) +curl -H "Authorization: Bearer {admin-token}" http://localhost:8080/api/users/999 +``` + +## API Documentation + +### GET /api/users/{id} + +Retrieve user by ID (Admin only). + +**Parameters:** +- `id` (path) - User ID (Long, required) + +**Headers:** +- `Authorization: Bearer {jwt-token}` (required) + +**Responses:** + +- **200 OK** - User found and returned +```json +{ + "id": 1, + "name": "Admin User", + "email": "admin@example.com", + "role": "ADMIN" +} +``` + +- **401 Unauthorized** - Missing or invalid JWT token +- **403 Forbidden** - Insufficient permissions (non-admin user) +- **404 Not Found** - User not found +```json +{ + "error": "Not Found", + "message": "User not found with id: 999", + "timestamp": "2025-09-02T07:00:00.000", + "status": 404 +} +``` + +## Test Data + +The application automatically loads test data: + +1. **ID: 1** - Admin User (admin@example.com, ADMIN) +2. **ID: 2** - Regular User (user@example.com, USER) +3. **ID: 3** - Test User (test@example.com, USER) + +## Database Console + +For development, H2 console is available at: `http://localhost:8080/h2-console` + +- **JDBC URL:** `jdbc:h2:mem:testdb` +- **Username:** `sa` +- **Password:** (empty) \ No newline at end of file