Polishing.
Reformat code, fix ticket references in tests. See #3820 Original pull request: #3821.
This commit is contained in:
@@ -35,7 +35,7 @@ public class MongoServerApiFactoryBean implements FactoryBean<ServerApi> {
|
||||
private @Nullable Boolean deprecationErrors;
|
||||
private @Nullable Boolean strict;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param version the version string either as the enum name or the server version value.
|
||||
* @see ServerApiVersion
|
||||
*/
|
||||
|
||||
@@ -21,10 +21,10 @@ import static org.springframework.test.util.ReflectionTestUtils.*;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.mongodb.ServerApiVersion;
|
||||
import org.bson.UuidRepresentation;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.mongodb.core.MongoClientFactoryBean;
|
||||
@@ -35,6 +35,7 @@ import com.mongodb.ConnectionString;
|
||||
import com.mongodb.MongoClientSettings;
|
||||
import com.mongodb.MongoCredential;
|
||||
import com.mongodb.ServerAddress;
|
||||
import com.mongodb.ServerApiVersion;
|
||||
import com.mongodb.connection.ClusterType;
|
||||
|
||||
/**
|
||||
@@ -149,7 +150,7 @@ public class MongoClientNamespaceTests {
|
||||
assertThat(settings.getUuidRepresentation()).isEqualTo(UuidRepresentation.STANDARD);
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-2427
|
||||
@Test // GH-3820
|
||||
public void clientWithServerVersion() {
|
||||
|
||||
assertThat(ctx.containsBean("client-with-server-api-settings")).isTrue();
|
||||
|
||||
@@ -17,24 +17,24 @@ package org.springframework.data.mongodb.core;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import com.mongodb.ServerApi;
|
||||
import com.mongodb.ServerApiVersion;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
import com.mongodb.AutoEncryptionSettings;
|
||||
import com.mongodb.ServerApi;
|
||||
import com.mongodb.ServerApiVersion;
|
||||
|
||||
/**
|
||||
* Integration tests for {@link MongoServerApiFactoryBean}.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
public class MongoServerApiFactoryBeanTests {
|
||||
class MongoServerApiFactoryBeanTests {
|
||||
|
||||
@Test // DATAMONGO-2306
|
||||
public void createsServerApiForVersionString() {
|
||||
@Test // GH-3820
|
||||
void createsServerApiForVersionString() {
|
||||
|
||||
RootBeanDefinition definition = new RootBeanDefinition(MongoServerApiFactoryBean.class);
|
||||
definition.getPropertyValues().addPropertyValue("version", "V1");
|
||||
@@ -52,8 +52,8 @@ public class MongoServerApiFactoryBeanTests {
|
||||
assertThat(target.getStrict()).isNotPresent();
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-2306
|
||||
public void createsServerApiForVersionNumber() {
|
||||
@Test // GH-3820
|
||||
void createsServerApiForVersionNumber() {
|
||||
|
||||
RootBeanDefinition definition = new RootBeanDefinition(MongoServerApiFactoryBean.class);
|
||||
definition.getPropertyValues().addPropertyValue("version", "1");
|
||||
|
||||
Reference in New Issue
Block a user