Skip to content

Commit

Permalink
LDAP-300: Fix NPE for DefaultObjectDirectoryMapper in uber jar
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Winch committed May 21, 2014
1 parent ab88cab commit a154120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -75,8 +75,8 @@ public DefaultObjectDirectoryMapper() {
private static ConverterManager createDefaultConverterManager() {
String springVersion = SpringVersion.getVersion();
if(springVersion == null) {
LOG.debug("Could not default convertManager, please ensure to explicitly set it");
return null;
LOG.debug("Could not determine the Spring Version. Guessing > Spring 3.0. If this does not work, please ensure to explicitly set converterManager");
return new ConversionServiceConverterManager();
} else if(springVersion.compareTo("3.0") > 0) {
return new ConversionServiceConverterManager();
} else {
Expand Down
Expand Up @@ -18,6 +18,7 @@
import org.junit.Test;
import org.junit.matchers.JUnitMatchers;
import org.junit.runner.RunWith;
import org.mockito.internal.util.reflection.Whitebox;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.core.SpringVersion;
Expand All @@ -44,7 +45,10 @@ public void springVersionIsNull() {
spy(SpringVersion.class);
when(SpringVersion.getVersion()).thenReturn(null);

new DefaultObjectDirectoryMapper();
DefaultObjectDirectoryMapper mapper = new DefaultObjectDirectoryMapper();

// LDAP-300
assertNotNull(Whitebox.getInternalState(mapper,"converterManager"));
}

@Test
Expand Down

0 comments on commit a154120

Please sign in to comment.