springboot
![[spring] SpringBoot mongodb 인덱싱 안되는 문제 (SpringBoot mongodb Unique index not created)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcza4A3%2FbtrBOvbxqc3%2FSAz2lTmMhLNMR3MxhCiAh0%2Fimg.png)
[spring] SpringBoot mongodb 인덱싱 안되는 문제 (SpringBoot mongodb Unique index not created)
embedded mongodb를 사용해 테스트를 진행했다. 인덱스가 중복되는 Entity를 저장하려 할 경우에 DuplicateKeyException 에러를 던질 줄 알았지만.. 아무일도 일어나지 않았다. @Document(collection = "products") @NoArgsConstructor @Getter @Setter public class ProductEntity { @Id private String id; @Version private Integer version; @Indexed(unique = true) private int productId; ... } 테스트에 사용중인 Entity의 일부이다. productId에 @Indexed 어노테이션을 unique = true 로 걸어주었다. ..
![[Spring] mongoDB Test Error (Error creating bean with name 'embeddedMongoServer' defined in class path resource)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlpuhL%2FbtrBN4rrPqV%2F20l80YenTvOeB0c3KZJmRK%2Fimg.png)
[Spring] mongoDB Test Error (Error creating bean with name 'embeddedMongoServer' defined in class path resource)
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-05-10 23:00:10.030 ERROR 7765 --- [ Test worker] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'embeddedMongoServer' defined in class path resource [org/springframework/boot/aut..