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:
Greg Turnquist
2017-09-06 09:43:35 -05:00
parent 92dd4f8401
commit d7ad6d320f
2 changed files with 6 additions and 14 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}
}