[ BAEL-1869 ]: Use couchbase.properties instead of application.properties. Exclude mongo auto in couchbase to boost performance

This commit is contained in:
Lukasz Rys 2019-09-15 10:20:21 +02:00
parent b63ad29ecc
commit 2bbf63e7f6
4 changed files with 10 additions and 2 deletions

View File

@ -2,8 +2,9 @@ package com.baeldung.couchbase;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
@SpringBootApplication
@SpringBootApplication(exclude = MongoAutoConfiguration.class)
public class ReactiveCouchbaseApplication {
public static void main(String[] args) {

View File

@ -1,12 +1,15 @@
package com.baeldung.couchbase.configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import java.util.Collections;
import java.util.List;
@Configuration
@PropertySource("classpath:couchbase.properties")
public class CouchbaseProperties {
private final List<String> bootstrapHosts;

View File

@ -0,0 +1,4 @@
spring.couchbase.bucket.name=default
spring.couchbase.bootstrap-hosts=localhost
spring.couchbase.port=8091
spring.couchbase.bucket.password=123456

View File

@ -17,7 +17,7 @@ import reactor.test.StepVerifier;
import java.util.UUID;
@RunWith(SpringRunner.class)
@SpringBootTest(properties = { "spring.couchbase.port=10010", "spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration" },
@SpringBootTest(properties = { "spring.couchbase.port=10010", "spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration,org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration" },
classes = { CouchbaseMockConfiguration.class, ViewReactiveCouchbaseConfiguration.class, CouchbaseProperties.class })
public class ViewPersonRepositoryIntegrationTest {