mongoDB

    [spring] SpringBoot mongodb 인덱싱 안되는 문제 (SpringBoot mongodb Unique index not created)

    [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)

    [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..