Skip to content

Commit

Permalink
(feat) make embedded mongodb version configurable and set to 3.4.10
Browse files Browse the repository at this point in the history
(cherry picked from commit 15b4139)
  • Loading branch information
jonathanlermitage committed Jan 27, 2018
1 parent 37e1be5 commit 161d321
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,6 @@
<version>${embed.mongo.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cz.jirutka.spring</groupId>
<artifactId>embedmongo-spring</artifactId>
<version>${embedmongo-spring.version}</version>
<scope>test</scope>
</dependency>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Annotations. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"name": "manon.batch.UserSnapshotTask.userSnapshot.maxAge",
"type": "java.lang.Integer",
"description": "UserSnapshotTask: user snapshot max age in days."
},
{
"name": "manon.mongodb.version",
"type": "java.lang.String",
"description": "MongoDB version, used to configure test embedded database."
}
]
}
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ manon:
UserSnapshotTask:
user.chunk: 1000
userSnapshot.maxAge: 30
mongodb.version: "3.4.10"
security.bcrypt.strength: 6
22 changes: 22 additions & 0 deletions src/test/java/manon/app/config/MongoConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package manon.app.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class MongoConfig {

@Value("${manon.mongodb.version}")
private String mongodbVersion;

@Bean
@Primary
public EmbeddedMongoProperties getEmbeddedMongoProperties() {
EmbeddedMongoProperties embeddedMongoProperties = new EmbeddedMongoProperties();
embeddedMongoProperties.setVersion(mongodbVersion);
return embeddedMongoProperties;
}
}

0 comments on commit 161d321

Please sign in to comment.