Skip to content

Commit

Permalink
Update MongoDB samples.
Browse files Browse the repository at this point in the history
Use default MongoDB container in tests and remove sample for deprecated server side scripting.
  • Loading branch information
christophstrobl committed Nov 22, 2024
1 parent 87f80ff commit a4c5214
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 130 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

import example.springdata.mongodb.Customer;
import example.springdata.mongodb.QCustomer;

import example.springdata.mongodb.util.MongoContainers;
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.data.mongo.DataMongoTest;
import org.springframework.data.mongodb.core.MongoOperations;
Expand All @@ -31,7 +30,6 @@
import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

/**
* @author Christoph Strobl
Expand All @@ -41,8 +39,7 @@
class CustomerRepositoryTests {

@Container //
private static MongoDBContainer mongoDBContainer = new MongoDBContainer(
DockerImageName.parse("mongo:5.0"));
private static MongoDBContainer mongoDBContainer = MongoContainers.getDefaultContainer();

@DynamicPropertySource
static void setProperties(DynamicPropertyRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class MongoContainers {

private static final String IMAGE_NAME = "mongo:5.0";
private static final String IMAGE_NAME = "mongo:8.0";
private static final String IMAGE_NAME_PROPERTY = "mongo.default.image.name";

public static MongoDBContainer getDefaultContainer() {
Expand Down

0 comments on commit a4c5214

Please sign in to comment.