Switch default session converter to JDK
The Jackson-based session converter doesn't work as expected, so switching to JDK-based one for now until we can write more tests and determine what is wrong.
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package org.springframework.session.data.mongo;
|
||||
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Provider choosing proper AbstractMongoSessionConverter.
|
||||
*
|
||||
@@ -30,13 +28,7 @@ final class SessionConverterProvider {
|
||||
}
|
||||
|
||||
static AbstractMongoSessionConverter getDefaultMongoConverter() {
|
||||
|
||||
if (ClassUtils.isPresent(JACKSON_CLASS_NAME, null)) {
|
||||
return new JacksonMongoSessionConverter();
|
||||
}
|
||||
else {
|
||||
return new JdkMongoSessionConverter();
|
||||
}
|
||||
return new JdkMongoSessionConverter();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultSessionConverterShouldBeJacksonWhenOnClasspath() throws IllegalAccessException {
|
||||
public void defaultSessionConverterShouldBeJdkWhenOnClasspath() throws IllegalAccessException {
|
||||
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(GoodConfig.class);
|
||||
@@ -84,7 +84,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
|
||||
|
||||
assertThat(converter)
|
||||
.extracting(AbstractMongoSessionConverter::getClass)
|
||||
.contains(JacksonMongoSessionConverter.class);
|
||||
.contains(JdkMongoSessionConverter.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -100,7 +100,7 @@ public class ReactiveMongoWebSessionConfigurationTest {
|
||||
|
||||
assertThat(converter)
|
||||
.extracting(AbstractMongoSessionConverter::getClass)
|
||||
.contains(JdkMongoSessionConverter.class);
|
||||
.contains(JacksonMongoSessionConverter.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -171,8 +171,8 @@ public class ReactiveMongoWebSessionConfigurationTest {
|
||||
}
|
||||
|
||||
@Bean
|
||||
JdkMongoSessionConverter mongoSessionConverter() {
|
||||
return new JdkMongoSessionConverter();
|
||||
AbstractMongoSessionConverter mongoSessionConverter() {
|
||||
return new JacksonMongoSessionConverter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user