DATAREDIS-576 - Polishing.

Update Javadoc, apply missing @Nullable annotations, add tests and alter makefile to use Redis 4.0.2.

Original Pull Request: #285
This commit is contained in:
Christoph Strobl
2017-10-19 10:13:14 +02:00
parent 5059887a76
commit 1e2a0f858f
5 changed files with 44 additions and 20 deletions

View File

@@ -73,4 +73,14 @@ public class LettuceClientConfigurationUnitTests {
assertThat(configuration.getCommandTimeout()).isEqualTo(Duration.ofMinutes(5));
assertThat(configuration.getShutdownTimeout()).isEqualTo(Duration.ofHours(2));
}
@Test(expected = IllegalArgumentException.class) // DATAREDIS-576
public void clientConfigurationThrowsExceptionForNullClientName() {
LettuceClientConfiguration.builder().clientName(null);
}
@Test(expected = IllegalArgumentException.class) // DATAREDIS-576
public void clientConfigurationThrowsExceptionForEmptyClientName() {
LettuceClientConfiguration.builder().clientName(" ");
}
}

View File

@@ -372,12 +372,12 @@ public class LettuceConnectionFactoryTests {
factory.setShareNativeConnection(false);
factory.afterPropertiesSet();
ConnectionFactoryTracker.add(factory);
RedisConnection connection = factory.getConnection();
assertThat(connection.getClientName(), is(equalTo("clientName")));
connection.close();
factory.destroy();
}
@Test // DATAREDIS-576
@@ -388,11 +388,11 @@ public class LettuceConnectionFactoryTests {
factory.setClientName("clientName");
factory.afterPropertiesSet();
ConnectionFactoryTracker.add(factory);
RedisConnection connection = factory.getConnection();
assertThat(connection.getClientName(), equalTo("clientName"));
connection.close();
factory.destroy();
}
}