diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlClusterFactoryBeanUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlClusterFactoryBeanUnitTests.java
index b473a9d4d..884943009 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlClusterFactoryBeanUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlClusterFactoryBeanUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,15 +38,10 @@ import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
*
* @author Mark Paluch
* @author John Blum
- * @see DATACASS-226
*/
public class CassandraCqlClusterFactoryBeanUnitTests {
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldInitializeWithoutAnyOptions() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -58,11 +53,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getMetricsOptions().isJMXReportingEnabled()).isTrue();
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldShutdownClusterInstance() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -72,11 +63,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(bean.getObject().isClosed()).isTrue();
}
- /**
- * @see DATACASS-217
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-217
public void shouldSetLZ4CompressionType() throws Exception {
CompressionType compressionType = CompressionType.LZ4;
@@ -88,11 +75,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getProtocolOptions(bean).getCompression()).isEqualTo(Compression.LZ4);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetSnappyCompressionType() throws Exception {
CompressionType compressionType = CompressionType.SNAPPY;
@@ -104,11 +87,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getProtocolOptions().getCompression()).isEqualTo(Compression.SNAPPY);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetPoolingOptions() throws Exception {
PoolingOptions poolingOptions = new PoolingOptions();
@@ -120,11 +99,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getPoolingOptions()).isEqualTo(poolingOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetSocketOptions() throws Exception {
SocketOptions socketOptions = new SocketOptions();
@@ -136,11 +111,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getSocketOptions()).isEqualTo(socketOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetQueryOptions() throws Exception {
QueryOptions queryOptions = new QueryOptions();
@@ -152,11 +123,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getQueryOptions()).isEqualTo(queryOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void defaultQueryOptionsShouldHaveOwnObjectIdentity() throws Exception {
QueryOptions queryOptions = new QueryOptions();
@@ -168,11 +135,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getQueryOptions()).isNotEqualTo(queryOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetAuthProvider() throws Exception {
AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
@@ -184,12 +147,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getProtocolOptions().getAuthProvider()).isEqualTo(authProvider);
}
- /**
- * @see DATACASS-226
- * @see DATACASS-263
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226, DATACASS-263
public void shouldSetAuthenticationProvider() throws Exception {
AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
@@ -202,12 +160,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(result).isEqualTo(authProvider);
}
- /**
- * @see DATACASS-226
- * @see DATACASS-263
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226, DATACASS-263
public void shouldSetAuthentication() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -221,11 +174,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(ReflectionTestUtils.getField(result, "password")).isEqualTo((Object) "password");
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetLoadBalancingPolicy() throws Exception {
LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
@@ -237,11 +186,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getPolicies().getLoadBalancingPolicy()).isEqualTo(loadBalancingPolicy);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetReconnectionPolicy() throws Exception {
ReconnectionPolicy reconnectionPolicy = new ExponentialReconnectionPolicy(1, 2);
@@ -253,11 +198,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getPolicies().getReconnectionPolicy()).isEqualTo(reconnectionPolicy);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetProtocolVersion() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -268,11 +209,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
.contains(ProtocolVersion.V2);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetSslOptions() throws Exception {
SSLOptions sslOptions = JdkSSLOptions.builder().build();
@@ -285,11 +222,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getProtocolOptions().getSSLOptions()).isEqualTo(sslOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldDisableMetrics() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -299,11 +232,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getConfiguration(bean).getMetricsOptions().isEnabled()).isFalse();
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldDisableJmxReporting() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -325,10 +254,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
verify(mockClusterBuilderConfigurer, times(1)).configure(isA(Cluster.Builder.class));
}
- /**
- * @see DATACASS-316
- */
- @Test
+ @Test // DATACASS-316
public void shouldSetAddressTranslator() throws Exception {
AddressTranslator mockAddressTranslator = mock(AddressTranslator.class);
@@ -340,10 +266,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getPolicies(bean).getAddressTranslator()).isEqualTo(mockAddressTranslator);
}
- /**
- * @see DATACASS-317
- */
- @Test
+ @Test // DATACASS-317
public void shouldSetClusterNameWithBeanNameProperty() throws Exception {
final Cluster.Builder mockClusterBuilder = mock(Cluster.Builder.class);
@@ -364,10 +287,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
verify(mockClusterBuilder, times(1)).withClusterName(eq("ABC"));
}
- /**
- * @see DATACASS-317
- */
- @Test
+ @Test // DATACASS-317
public void shouldSetClusterNameWithClusterNameProperty() throws Exception {
final Cluster.Builder mockClusterBuilder = mock(Cluster.Builder.class);
@@ -388,10 +308,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
verify(mockClusterBuilder, times(1)).withClusterName(eq("XYZ"));
}
- /**
- * @see DATACASS-319
- */
- @Test
+ @Test // DATACASS-319
public void shouldSetMaxSchemaAgreementWaitSeconds() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -402,10 +319,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getProtocolOptions(bean).getMaxSchemaAgreementWaitSeconds()).isEqualTo(20);
}
- /**
- * @see DATACASS-320
- */
- @Test
+ @Test // DATACASS-320
public void shouldSetSpeculativeExecutionPolicy() throws Exception {
SpeculativeExecutionPolicy mockSpeculativeExecutionPolicy = mock(SpeculativeExecutionPolicy.class);
@@ -417,10 +331,7 @@ public class CassandraCqlClusterFactoryBeanUnitTests {
assertThat(getPolicies(bean).getSpeculativeExecutionPolicy()).isEqualTo(mockSpeculativeExecutionPolicy);
}
- /**
- * @see DATACASS-238
- */
- @Test
+ @Test // DATACASS-238
public void shouldSetTimestampGenerator() throws Exception {
TimestampGenerator mockTimestampGenerator = mock(TimestampGenerator.class);
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlSessionFactoryBeanUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlSessionFactoryBeanUnitTests.java
index cc342472b..be6a0dbef 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlSessionFactoryBeanUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/CassandraCqlSessionFactoryBeanUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2016 the original author or authors
+ * Copyright 2013-2017 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import static org.mockito.Mockito.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import org.junit.Before;
@@ -45,8 +46,6 @@ import com.datastax.driver.core.Session;
*
* @author John Blum
* @see org.springframework.cassandra.config.CassandraCqlSessionFactoryBean
- * @see expectedStartupScripts = asList("/path/to/schema.cql", "/path/to/data.cql");
+
+ List expectedStartupScripts = Arrays.asList("/path/to/schema.cql", "/path/to/data.cql");
CqlOperations mockCqlOperations = mock(CqlOperations.class);
@@ -115,10 +107,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
verify(mockCqlOperations, times(1)).execute(eq(expectedStartupScripts.get(1)));
}
- @Test
+ @Test // DATACASS-219
public void connectToSystemKeyspace() {
- when(mockCluster.connect()).thenReturn(mockSession);
+ when(mockCluster.connect()).thenReturn(mockSession);
factoryBean.setCluster(mockCluster);
assertThat(factoryBean.connect(null)).isEqualTo(mockSession);
@@ -127,10 +119,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
verify(mockCluster, never()).connect(anyString());
}
- @Test
+ @Test // DATACASS-219
public void connectToTargetKeyspace() {
- when(mockCluster.connect(eq("TestKeyspace"))).thenReturn(mockSession);
+ when(mockCluster.connect(eq("TestKeyspace"))).thenReturn(mockSession);
factoryBean.setCluster(mockCluster);
assertThat(factoryBean.connect("TestKeyspace")).isEqualTo(mockSession);
@@ -139,10 +131,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
verify(mockCluster, times(1)).connect(eq("TestKeyspace"));
}
- @Test
+ @Test // DATACASS-219
@SuppressWarnings("unchecked")
public void destroySessionAndExecutesShutdownScripts() throws Exception {
- List expectedShutdownScripts = asList("/path/to/shutdown.cql");
+ List expectedShutdownScripts = Collections.singletonList("/path/to/shutdown.cql");
CqlOperations mockCqlOperations = mock(CqlOperations.class);
@@ -159,35 +151,42 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
inOrder.verify(mockSession, times(1)).close();
}
- @Test
+ @Test // DATACASS-219
public void isConnectedWithNullSessionIsFalse() {
+
assertThat(factoryBean.getObject()).isNull();
assertThat(factoryBean.isConnected()).isFalse();
}
- @Test
+ @Test // DATACASS-219
public void isConnectedWithClosedSessionIsFalse() {
- doReturn(mockSession).when(factoryBean).getObject();
+
+ when(factoryBean.getObject()).thenReturn(mockSession);
when(mockSession.isClosed()).thenReturn(true);
+
assertThat(factoryBean.isConnected()).isFalse();
verify(mockSession, times(1)).isClosed();
}
- @Test
+ @Test // DATACASS-219
public void isConnectedWithOpenSessionIsTrue() {
- doReturn(mockSession).when(factoryBean).getObject();
+
+ when(factoryBean.getObject()).thenReturn(mockSession);
when(mockSession.isClosed()).thenReturn(false);
+
assertThat(factoryBean.isConnected()).isTrue();
verify(mockSession, times(1)).isClosed();
}
- @Test
+ @Test // DATACASS-219
public void setAndGetCluster() {
+
factoryBean.setCluster(mockCluster);
+
assertThat(factoryBean.getCluster()).isEqualTo(mockCluster);
}
- @Test
+ @Test // DATACASS-219
public void setClusterToNullThrowsIllegalArgumentException() {
try {
@@ -199,7 +198,7 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
}
- @Test
+ @Test // DATACASS-219
public void getClusterWhenUninitializedThrowsIllegalStateException() {
try {
@@ -210,20 +209,19 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
}
}
- @Test
+ @Test // DATACASS-219
public void setAndGetKeyspaceName() {
+
assertThat(factoryBean.getKeyspaceName()).isNull();
factoryBean.setKeyspaceName("TEST");
-
assertThat(factoryBean.getKeyspaceName()).isEqualTo("TEST");
factoryBean.setKeyspaceName(null);
-
assertThat(factoryBean.getKeyspaceName()).isNull();
}
- @Test
+ @Test // DATACASS-219
public void getSessionWhenUninitializedThrowsIllegalStateException() {
assertThat(factoryBean.getObject()).isNull();
@@ -237,26 +235,25 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
}
- @Test
+ @Test // DATACASS-219
public void setAndGetStartupScripts() {
+
assertNonNullEmptyCollection(factoryBean.getStartupScripts());
- List expectedStartupScripts = asList("/path/to/schema.cql", "/path/to/data.cql");
-
+ List expectedStartupScripts = Arrays.asList("/path/to/schema.cql", "/path/to/data.cql");
factoryBean.setStartupScripts(expectedStartupScripts);
List actualStartupScripts = factoryBean.getStartupScripts();
-
assertThat(actualStartupScripts).isNotSameAs(expectedStartupScripts).isEqualTo(expectedStartupScripts);
factoryBean.setStartupScripts(null);
-
assertNonNullEmptyCollection(factoryBean.getStartupScripts());
}
- @Test
+ @Test // DATACASS-219
public void startupScriptsAreImmutable() {
- List startupScripts = asList("/path/to/startup.cql");
+
+ List startupScripts = new ArrayList(Collections.singletonList("/path/to/startup.cql"));
factoryBean.setStartupScripts(startupScripts);
@@ -282,29 +279,26 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
@Test
public void setAndGetShutdownScripts() {
+
assertNonNullEmptyCollection(factoryBean.getShutdownScripts());
- List expectedShutdownScripts = asList("/path/to/backup.cql", "/path/to/dropTables.cql");
-
+ List expectedShutdownScripts = Arrays.asList("/path/to/backup.cql", "/path/to/dropTables.cql");
factoryBean.setShutdownScripts(expectedShutdownScripts);
List actualShutdownScripts = factoryBean.getShutdownScripts();
-
assertThat(actualShutdownScripts).isEqualTo(expectedShutdownScripts).isNotSameAs(expectedShutdownScripts);
factoryBean.setShutdownScripts(null);
-
assertNonNullEmptyCollection(factoryBean.getShutdownScripts());
}
- @Test
+ @Test // DATACASS-219
public void shutdownScriptsAreImmutable() {
- List shutdownScripts = asList("/path/to/shutdown.cql");
+ List shutdownScripts = new ArrayList(Collections.singletonList("/path/to/shutdown.cql"));
factoryBean.setShutdownScripts(shutdownScripts);
List actualShutdownScripts = factoryBean.getShutdownScripts();
-
assertThat(actualShutdownScripts).isEqualTo(shutdownScripts).isNotSameAs(shutdownScripts);
shutdownScripts.add("/path/to/corruptSession.cql");
@@ -321,4 +315,10 @@ public class CassandraCqlSessionFactoryBeanUnitTests {
assertThat(actualShutdownScripts).hasSize(1);
}
}
+
+ private void assertNonNullEmptyCollection(Collection> collection) {
+
+ assertThat(collection).isNotNull();
+ assertThat(collection.isEmpty()).isTrue();
+ }
}
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/PoolingOptionsFactoryBeanUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/PoolingOptionsFactoryBeanUnitTests.java
index 791a6fcc4..944b0ae4a 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/PoolingOptionsFactoryBeanUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/PoolingOptionsFactoryBeanUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,8 +47,6 @@ import com.datastax.driver.core.PoolingOptions;
* @author David Webb
* @author John Blum
* @author Mark Paluch
- * @see DATACASS-176
- * @see DATACASS-298
*/
@RunWith(MockitoJUnitRunner.class)
public class PoolingOptionsFactoryBeanUnitTests {
@@ -63,7 +61,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
poolingOptionsFactoryBean = new PoolingOptionsFactoryBean();
}
- @Test
+ @Test // DATACASS-176, DATACASS-298
public void getObjectReturnsNullWhenNotInitialized() throws Exception {
assertThat(poolingOptionsFactoryBean.getObject()).isNull();
}
@@ -79,11 +77,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
assertThat(poolingOptionsFactoryBean.isSingleton()).isTrue();
}
- /**
- * @see DATACASS-298
- * @see DATACASS-344
- */
- @Test
+ @Test // DATACASS-298, DATACASS-344
public void setAndGetFactoryBeanProperties() {
poolingOptionsFactoryBean.setHeartbeatIntervalSeconds(15);
@@ -113,10 +107,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
assertThat(poolingOptionsFactoryBean.getRemoteMinSimultaneousRequests()).isEqualTo(50);
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void afterPropertiesSetInitializesLocalPoolingOptions() throws Exception {
PoolingOptionsFactoryBean poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
@@ -157,10 +148,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
verify(poolingOptionsSpy, never()).setNewConnectionThreshold(eq(HostDistance.REMOTE), anyInt());
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void afterPropertiesSetInitializesRemotePoolingOptions() throws Exception {
PoolingOptionsFactoryBean poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
@@ -201,10 +189,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
verify(poolingOptionsSpy, never()).setNewConnectionThreshold(eq(HostDistance.REMOTE), eq(5));
}
- /**
- * @see DATACASS-344
- */
- @Test
+ @Test // DATACASS-344
public void afterPropertiesSetInitializesMaxQueueSize() throws Exception {
Method setMaxQueueSize = ReflectionUtils.findMethod(PoolingOptions.class, "setMaxQueueSize", int.class);
@@ -234,11 +219,8 @@ public class PoolingOptionsFactoryBeanUnitTests {
* driver class type... {@link PoolingOptions}! The max values should be set before setting core values. Otherwise the
* core values will be compared with the default max values which is 8. Same for other min-max properties pairs. This
* test checks the same.
- *
- * @throws Exception Any unhandled scenarios will result in a test failure.
- * @see DATACASS-176
*/
- @Test
+ @Test // DATACASS-176
public void afterPropertiesSetProperlySetsPoolingOptionsMaxBeforeMinProperties() throws Exception {
poolingOptionsFactoryBean = new PoolingOptionsFactoryBean() {
@@ -283,10 +265,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
verify(poolingOptions).setNewConnectionThreshold(eq(HostDistance.REMOTE), eq(111));
}
- /**
- * @see DATACASS-176
- */
- @Test
+ @Test // DATACASS-176
public void newLocalHostDistancePoolingOptionsReturnsLocalHostDistancePoolingOptionsFactoryBeanSettings() {
poolingOptionsFactoryBean.setLocalCoreConnections(50);
@@ -308,10 +287,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
assertThat(poolingOptions.getNewConnectionThreshold()).isEqualTo(100);
}
- /**
- * @see DATACASS-176
- */
- @Test
+ @Test // DATACASS-176
public void newLocalHostDistancePoolingOptionsReturnsRemoteHostDistancePoolingOptionsFactoryBeanSettings() {
poolingOptionsFactoryBean.setLocalCoreConnections(50);
@@ -333,10 +309,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
assertThat(poolingOptions.getNewConnectionThreshold()).isEqualTo(40);
}
- /**
- * @see DATACASS-176
- */
- @Test
+ @Test // DATACASS-176
public void configureLocalHostDistancePoolingOptionsCallsConfigureWithExpectedInstance() {
final PoolingOptionsFactoryBean.HostDistancePoolingOptions mockHostDistancePoolingOptions = mock(
@@ -362,10 +335,7 @@ public class PoolingOptionsFactoryBeanUnitTests {
verify(mockHostDistancePoolingOptions).configure(same(poolingOptionsSpy));
}
- /**
- * @see DATACASS-176
- */
- @Test
+ @Test // DATACASS-176
public void configureRemoteHostDistancePoolingOptionsCallsConfigureWithExpectedInstance() {
final PoolingOptionsFactoryBean.HostDistancePoolingOptions mockHostDistancePoolingOptions = mock(
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/java/AbstractClusterConfigurationUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/java/AbstractClusterConfigurationUnitTests.java
index d8db161c5..0af2c7b9e 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/java/AbstractClusterConfigurationUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/java/AbstractClusterConfigurationUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,15 +45,10 @@ import com.datastax.driver.core.policies.SpeculativeExecutionPolicy;
* @author Mark Paluch
* @author John Blum
* @soundtrack Max Graham Feat Neev Kennedy - So Caught Up (Dns Project Remix)
- * @see
*/
public class AbstractClusterConfigurationUnitTests {
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldInitializeWithoutAnyOptions() throws Exception {
CassandraCqlClusterFactoryBean bean = new CassandraCqlClusterFactoryBean();
@@ -68,11 +63,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getMetricsOptions().isJMXReportingEnabled()).isTrue();
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetCompressionType() throws Exception {
final CompressionType compressionType = CompressionType.SNAPPY;
@@ -88,11 +79,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getProtocolOptions().getCompression()).isEqualTo(Compression.SNAPPY);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetPoolingOptions() throws Exception {
final PoolingOptions poolingOptions = new PoolingOptions();
@@ -108,11 +95,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getPoolingOptions()).isEqualTo(poolingOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetSocketOptions() throws Exception {
final SocketOptions socketOptions = new SocketOptions();
@@ -128,11 +111,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getSocketOptions()).isEqualTo(socketOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetQueryOptions() throws Exception {
final QueryOptions queryOptions = new QueryOptions();
@@ -148,11 +127,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getQueryOptions()).isEqualTo(queryOptions);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetAuthProvider() throws Exception {
final AuthProvider authProvider = new PlainTextAuthProvider("x", "y");
@@ -168,11 +143,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getProtocolOptions().getAuthProvider()).isEqualTo(authProvider);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetLoadBalancingPolicy() throws Exception {
final LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
@@ -188,11 +159,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getPolicies().getLoadBalancingPolicy()).isEqualTo(loadBalancingPolicy);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetReconnectionPolicy() throws Exception {
final ReconnectionPolicy reconnectionPolicy = new ExponentialReconnectionPolicy(1, 2);
@@ -208,11 +175,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getPolicies().getReconnectionPolicy()).isEqualTo(reconnectionPolicy);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetProtocolVersion() throws Exception {
AbstractClusterConfiguration clusterConfiguration = new AbstractClusterConfiguration() {
@@ -227,11 +190,7 @@ public class AbstractClusterConfigurationUnitTests {
.contains(ProtocolVersion.V2);
}
- /**
- * @see DATACASS-226
- * @throws Exception
- */
- @Test
+ @Test // DATACASS-226
public void shouldDisableMetrics() throws Exception {
AbstractClusterConfiguration clusterConfiguration = new AbstractClusterConfiguration() {
@@ -245,10 +204,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(getConfiguration(cluster).getMetricsOptions().isEnabled()).isFalse();
}
- /**
- * @see DATACASS-226
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetKeyspaceCreations() {
final List specification = Collections
@@ -263,10 +219,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(clusterConfiguration.cluster().getKeyspaceCreations()).isEqualTo(specification);
}
- /**
- * @see DATACASS-226
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetKeyspaceDrops() {
final List specification = Collections
@@ -281,10 +234,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(clusterConfiguration.cluster().getKeyspaceDrops()).isEqualTo(specification);
}
- /**
- * @see DATACASS-226
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetStartupScripts() {
final List scripts = Collections.singletonList("USE BLUE_METH; CREATE TABLE...");
@@ -298,10 +248,7 @@ public class AbstractClusterConfigurationUnitTests {
assertThat(clusterConfiguration.cluster().getStartupScripts()).isEqualTo(scripts);
}
- /**
- * @see DATACASS-226
- */
- @Test
+ @Test // DATACASS-226
public void shouldSetShutdownScripts() {
final List scripts = Collections.singletonList("USE BLUE_METH; DROP TABLE...");
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/xml/CassandraCqlClusterParserUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/xml/CassandraCqlClusterParserUnitTests.java
index f298672e3..9208128cc 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/xml/CassandraCqlClusterParserUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/xml/CassandraCqlClusterParserUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2016 the original author or authors
+ * Copyright 2013-2017 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,10 +52,7 @@ public class CassandraCqlClusterParserUnitTests {
private CassandraCqlClusterParser parser = new CassandraCqlClusterParser();
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void resolveIdFromElement() {
when(mockElement.getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE))).thenReturn("test");
@@ -64,10 +61,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void resolveIdUsingDefault() {
when(mockElement.getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE))).thenReturn("");
@@ -76,10 +70,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getAttribute(eq(CassandraCqlClusterParser.ID_ATTRIBUTE));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseInternalCallsDoParseAndConstructsBeanDefinition() {
BeanDefinition mockContainingBeanDefinition = mock(BeanDefinition.class);
@@ -171,10 +162,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getAttribute(eq("username"));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseChildElementsWithLocalPoolingOptions() {
Element localPoolingOptionsElement = mock(Element.class);
@@ -228,10 +216,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(localPoolingOptionsElement).getAttribute(eq("min-simultaneous-requests"));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseChildElementsWithRemotePoolingOptions() {
Element localPoolingOptionsElement = mock(Element.class);
@@ -285,10 +270,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(localPoolingOptionsElement).getAttribute(eq("min-simultaneous-requests"));
}
- /**
- * @see DATACASS-242
- */
- @Test
+ @Test // DATACASS-242
public void parseChildElementsWithStartupAndShutdownScripts() {
Element mockStartupCqlOne = mock(Element.class, "MockStartupCqlOne");
@@ -322,10 +304,7 @@ public class CassandraCqlClusterParserUnitTests {
assertThat(shutdownScripts).contains("DROP KEYSPACE test;", "DROP USER jblum;");
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseLocalPoolingOptionsProperlyConfiguresBeanDefinition() {
when(mockElement.getAttribute(eq("core-connections"))).thenReturn("50");
@@ -362,10 +341,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getAttribute(eq("min-simultaneous-requests"));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseRemotePoolingOptionsProperlyConfiguresBeanDefinition() {
when(mockElement.getAttribute(eq("core-connections"))).thenReturn("50");
@@ -402,10 +378,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getAttribute(eq("min-simultaneous-requests"));
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void parseScript() {
when(mockElement.getTextContent()).thenReturn("CREATE TABLE schema.table;");
@@ -413,10 +386,7 @@ public class CassandraCqlClusterParserUnitTests {
verify(mockElement).getTextContent();
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void newSocketOptionsBeanDefinitionIsProperlyInitialized() {
when(mockElement.getAttribute(eq("connect-timeout-millis"))).thenReturn("15000");
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/config/xml/ParsingUtilsUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/config/xml/ParsingUtilsUnitTests.java
index 2af0756ea..00f8dafed 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/config/xml/ParsingUtilsUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/config/xml/ParsingUtilsUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2016 the original author or authors
+ * Copyright 2013-2017 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,10 +36,7 @@ public class ParsingUtilsUnitTests {
@Rule public ExpectedException exception = ExpectedException.none();
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addOptionalReferencePropertyUsesDefault() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -51,10 +48,7 @@ public class ParsingUtilsUnitTests {
assertThat(propertyValue.getBeanName()).isEqualTo("defaultBeanReference");
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addOptionalReferencePropertyWithNoValueDoesReturnsWithoutAdding() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -66,10 +60,7 @@ public class ParsingUtilsUnitTests {
assertThat(beanDefinition.getPropertyValues().isEmpty()).isTrue();
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addOptionalValuePropertyUsesDefault() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -80,10 +71,7 @@ public class ParsingUtilsUnitTests {
assertThat(propertyValue).isEqualTo("defaultValue");
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addOptionalValuePropertyWithNoValueDoesReturnsWithoutAdding() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -95,10 +83,7 @@ public class ParsingUtilsUnitTests {
assertThat(beanDefinition.getPropertyValues().isEmpty()).isTrue();
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addRequiredReferencePropertyIsSuccessful() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -110,10 +95,7 @@ public class ParsingUtilsUnitTests {
assertThat(propertyValue.getBeanName()).isEqualTo("reference");
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addRequiredReferencePropertyWithNoReferenceFails() {
exception.expect(IllegalArgumentException.class);
@@ -123,10 +105,7 @@ public class ParsingUtilsUnitTests {
"defaultReference", true, true);
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addRequiredValuePropertyIsSuccessful() {
BeanDefinitionBuilder builder = ParsingUtils.addProperty(BeanDefinitionBuilder.genericBeanDefinition(),
@@ -137,10 +116,7 @@ public class ParsingUtilsUnitTests {
assertThat(propertyValue).isEqualTo("value");
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addRequiredValuePropertyWithNoValueFails() {
exception.expect(IllegalArgumentException.class);
@@ -150,10 +126,7 @@ public class ParsingUtilsUnitTests {
false);
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addPropertyThrowsIllegalArgumentExceptionForNullBuilder() {
exception.expect(IllegalArgumentException.class);
@@ -162,10 +135,7 @@ public class ParsingUtilsUnitTests {
ParsingUtils.addProperty(null, "propertyName", "value", "defaultValue", false, false);
}
- /**
- * @see DATACASS-298
- */
- @Test
+ @Test // DATACASS-298
public void addPropertyThrowsIllegalArgumentExceptionForNullPropertyName() {
exception.expect(IllegalArgumentException.class);
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateIntegrationTests.java
index 460e428ce..18e710b04 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateIntegrationTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,10 +54,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
template.setSession(getSession());
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = 'WHITE'").get();
@@ -65,10 +62,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -79,10 +73,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user;", String.class).get();
@@ -90,10 +81,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user;").get();
@@ -101,10 +89,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldRemoveRecords() throws Exception {
template.execute(QueryBuilder.delete().from("user").where(QueryBuilder.eq("id", "WHITE"))).get();
@@ -112,10 +97,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryStatementShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -126,10 +108,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject(QueryBuilder.select("id").from("user"), String.class).get();
@@ -137,10 +116,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnMap() throws Exception {
Map map = template.queryForMap(QueryBuilder.select().from("user")).get();
@@ -148,10 +124,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeWithArgsShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = ?", "WHITE").get();
@@ -159,10 +132,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -173,10 +143,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -190,10 +157,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectWithArgsShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user WHERE id = ?;", String.class, "WHITE").get();
@@ -201,10 +165,7 @@ public class AsyncCqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIn
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectWithArgsShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user WHERE id = ?;", "WHITE").get();
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateUnitTests.java
index a33b73ffd..b0f18b4bb 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/AsyncCqlTemplateUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,10 +77,7 @@ public class AsyncCqlTemplateUnitTests {
// Tests dealing with a plain com.datastax.driver.core.Session
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCallbackShouldTranslateExceptions() throws Exception {
try {
@@ -94,10 +91,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldTranslateExceptions() throws Exception {
TestResultSetFuture resultSetFuture = TestResultSetFuture
@@ -120,10 +114,7 @@ public class AsyncCqlTemplateUnitTests {
// Tests dealing with static CQL
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -134,10 +125,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, asyncCqlTemplate -> {
@@ -148,10 +136,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForResultSetShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -163,10 +148,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetExtractorShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -179,10 +161,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, asyncCqlTemplate -> {
@@ -195,10 +174,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryCqlShouldTranslateExceptions() throws Exception {
TestResultSetFuture resultSetFuture = TestResultSetFuture
@@ -217,10 +193,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldBeEmpty() throws Exception {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -238,10 +211,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -251,10 +221,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldReturnNullValue() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -264,10 +231,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldFailReturningManyRecords() throws Exception {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -284,10 +248,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlWithTypeShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -301,10 +262,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListCqlWithTypeShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -318,10 +276,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldReturnWasApplied() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -336,10 +291,7 @@ public class AsyncCqlTemplateUnitTests {
// Tests dealing with com.datastax.driver.core.Statement
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -350,10 +302,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, asyncCqlTemplate -> {
@@ -364,10 +313,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForResultStatementSetShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -380,10 +326,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetStatementExtractorShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -396,10 +339,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetStatementExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, asyncCqlTemplate -> {
@@ -412,10 +352,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryStatementShouldTranslateExceptions() throws Exception {
TestResultSetFuture resultSetFuture = TestResultSetFuture
@@ -435,10 +372,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldBeEmpty() throws Exception {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -457,10 +391,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -471,10 +402,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnNullValue() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -485,10 +413,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldFailReturningManyRecords() throws Exception {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -506,10 +431,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementWithTypeShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -523,10 +445,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListStatementWithTypeShouldReturnRecord() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -541,10 +460,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldReturnWasApplied() {
when(session.executeAsync(any(Statement.class))).thenReturn(new TestResultSetFuture(resultSet));
@@ -559,10 +475,7 @@ public class AsyncCqlTemplateUnitTests {
// Methods dealing with prepared statements
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -579,10 +492,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, asyncCqlTemplate -> {
@@ -596,10 +506,7 @@ public class AsyncCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementCreatorShouldTranslateStatementCreationExceptions() throws Exception {
when(session.executeAsync(boundStatement)).thenReturn(new TestResultSetFuture(resultSet));
@@ -628,10 +535,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementCreatorShouldTranslateStatementCallbackExceptions() throws Exception {
when(session.executeAsync(boundStatement)).thenReturn(new TestResultSetFuture(resultSet));
@@ -652,10 +556,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorShouldReturnResult() {
when(session.prepareAsync(anyString())).thenReturn(new TestPreparedStatementFuture(preparedStatement));
@@ -670,10 +571,7 @@ public class AsyncCqlTemplateUnitTests {
verify(preparedStatement).bind();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldReturnResult() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -689,10 +587,7 @@ public class AsyncCqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslatePrepareStatementExceptions() throws Exception {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -712,10 +607,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslateBindExceptions() throws Exception {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -732,10 +624,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslateExecutionExceptions() throws Exception {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -758,10 +647,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderAndMapperShouldReturnResult() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -777,10 +663,7 @@ public class AsyncCqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldBeEmpty() throws Exception {
when(session.prepareAsync("SELECT * FROM user WHERE username = ?"))
@@ -802,10 +685,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldReturnRecord() {
when(session.prepareAsync("SELECT * FROM user WHERE username = ?"))
@@ -819,10 +699,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldFailReturningManyRecords() throws Exception {
when(session.prepareAsync("SELECT * FROM user WHERE username = ?"))
@@ -843,10 +720,7 @@ public class AsyncCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepareAsync("SELECT * FROM user WHERE username = ?"))
@@ -863,10 +737,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepareAsync("SELECT * FROM user WHERE username = ?"))
@@ -884,10 +755,7 @@ public class AsyncCqlTemplateUnitTests {
assertThat(getUninterruptibly(future)).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void updatePreparedStatementShouldReturnApplied() {
when(session.prepareAsync("UPDATE user SET username = ?"))
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/CachedPreparedStatementCreatorUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/CachedPreparedStatementCreatorUnitTests.java
index c66e3581c..fcca5805c 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/CachedPreparedStatementCreatorUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/CachedPreparedStatementCreatorUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@ import static org.assertj.core.api.Assertions.*;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.*;
+import edu.umd.cs.mtc.MultithreadedTestCase;
+
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -34,13 +36,10 @@ import org.mockito.runners.MockitoJUnitRunner;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.Session;
-import edu.umd.cs.mtc.MultithreadedTestCase;
-
/**
* Unit tests for {@link CachedPreparedStatementCreator}.
*
* @author Mark Paluch
- * @see DATACASS-253
*/
@RunWith(MockitoJUnitRunner.class)
public class CachedPreparedStatementCreatorUnitTests {
@@ -55,26 +54,17 @@ public class CachedPreparedStatementCreatorUnitTests {
when(sessionMock.prepare(anyString())).thenReturn(preparedStatement);
}
- /**
- * @see DATACASS-253
- */
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class) // DATACASS-253
public void shouldRejectEmptyCql() {
new CachedPreparedStatementCreator("");
}
- /**
- * @see DATACASS-253
- */
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class) // DATACASS-253
public void shouldRejectNullCql() {
new CachedPreparedStatementCreator(null);
}
- /**
- * @see DATACASS-253
- */
- @Test
+ @Test // DATACASS-253
public void shouldCreatePreparedStatement() {
CachedPreparedStatementCreator cachedPreparedStatementCreator = new CachedPreparedStatementCreator("my cql");
@@ -85,10 +75,7 @@ public class CachedPreparedStatementCreatorUnitTests {
verify(sessionMock).prepare("my cql");
}
- /**
- * @see DATACASS-253
- */
- @Test
+ @Test // DATACASS-253
public void shouldCacheCreatePreparedStatement() {
CachedPreparedStatementCreator cachedPreparedStatementCreator = new CachedPreparedStatementCreator("my cql");
@@ -102,11 +89,7 @@ public class CachedPreparedStatementCreatorUnitTests {
verify(sessionMock, times(1)).prepare("my cql");
}
- /**
- * @see DATACASS-253
- * @throws Throwable
- */
- @Test
+ @Test // DATACASS-253
public void concurrentAccessToCreateStatementShouldBeSynchronized() throws Throwable {
CreatePreparedStatementIsThreadSafe concurrentPrepareStatement = new CreatePreparedStatementIsThreadSafe(
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/ConsistencyLevelResolverUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/ConsistencyLevelResolverUnitTests.java
index 1ab994de0..12b0b75d3 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/ConsistencyLevelResolverUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/ConsistencyLevelResolverUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ import org.junit.runners.Parameterized.Parameters;
* Unit tests for {@link ConsistencyLevelResolver}.
*
* @author Mark Paluch
- * @see DATACASS-202
*/
@RunWith(Parameterized.class)
public class ConsistencyLevelResolverUnitTests {
@@ -80,10 +79,7 @@ public class ConsistencyLevelResolverUnitTests {
return parameters;
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void shouldResolveCorrectly() {
assertThat(ConsistencyLevelResolver.resolve(from)).isEqualTo(expected);
}
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateIntegrationTests.java
index 01ca49adb..41689d455 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateIntegrationTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,10 +53,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
template.setSession(getSession());
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = 'WHITE'");
@@ -64,10 +61,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -78,10 +72,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user;", String.class);
@@ -89,10 +80,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user;");
@@ -100,10 +88,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldRemoveRecords() throws Exception {
template.execute(QueryBuilder.delete().from("user").where(QueryBuilder.eq("id", "WHITE")));
@@ -111,10 +96,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryStatementShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -125,10 +107,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject(QueryBuilder.select("id").from("user"), String.class);
@@ -136,10 +115,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnMap() throws Exception {
Map map = template.queryForMap(QueryBuilder.select().from("user"));
@@ -147,10 +123,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeWithArgsShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = ?", "WHITE");
@@ -158,10 +131,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(session.execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -172,10 +142,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorShouldInvokeCallback() throws Exception {
List result = new ArrayList<>();
@@ -186,10 +153,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(result).contains("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectWithArgsShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user WHERE id = ?;", String.class, "WHITE");
@@ -197,10 +161,7 @@ public class CqlTemplateIntegrationTests extends AbstractKeyspaceCreatingIntegra
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectWithArgsShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user WHERE id = ?;", "WHITE");
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateUnitTests.java
index 0fbe254f6..a0dc5f408 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/CqlTemplateUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,10 +76,7 @@ public class CqlTemplateUnitTests {
// Tests dealing with a plain com.datastax.driver.core.Session
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCallbackShouldTranslateExceptions() {
try {
@@ -93,10 +90,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -113,10 +107,7 @@ public class CqlTemplateUnitTests {
// Tests dealing with static CQL
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -127,10 +118,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, cqlTemplate -> {
@@ -141,10 +129,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForResultSetShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -156,10 +141,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetExtractorShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -171,10 +153,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, cqlTemplate -> {
@@ -186,10 +165,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryCqlShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -202,10 +178,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldBeEmpty() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -219,10 +192,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -232,10 +202,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldReturnNullValue() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -245,10 +212,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlShouldFailReturningManyRecords() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -262,10 +226,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectCqlWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -279,10 +240,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListCqlWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -296,10 +254,7 @@ public class CqlTemplateUnitTests {
assertThat(result).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeCqlShouldReturnWasApplied() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -314,10 +269,7 @@ public class CqlTemplateUnitTests {
// Tests dealing with com.datastax.driver.core.Statement
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -328,10 +280,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, cqlTemplate -> {
@@ -342,10 +291,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForResultStatementSetShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -357,10 +303,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetStatementExtractorShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -373,10 +316,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryWithResultSetStatementExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, cqlTemplate -> {
@@ -389,10 +329,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryStatementShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -406,10 +343,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldBeEmpty() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -424,10 +358,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -437,10 +368,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldReturnNullValue() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -450,10 +378,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isNull();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementShouldFailReturningManyRecords() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -468,10 +393,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectStatementWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -485,10 +407,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListStatementWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -502,10 +421,7 @@ public class CqlTemplateUnitTests {
assertThat(result).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executeStatementShouldReturnWasApplied() {
when(session.execute(any(Statement.class))).thenReturn(resultSet);
@@ -520,10 +436,7 @@ public class CqlTemplateUnitTests {
// Methods dealing with prepared statements
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -539,10 +452,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, cqlTemplate -> {
@@ -556,10 +466,7 @@ public class CqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementCreatorShouldTranslateStatementCreationExceptions() {
when(session.execute(boundStatement)).thenReturn(resultSet);
@@ -576,10 +483,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void executePreparedStatementCreatorShouldTranslateStatementCallbackExceptions() {
when(session.execute(boundStatement)).thenReturn(resultSet);
@@ -596,10 +500,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorShouldReturnResult() {
when(session.prepare(anyString())).thenReturn(preparedStatement);
@@ -613,10 +514,7 @@ public class CqlTemplateUnitTests {
verify(preparedStatement).bind();
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldReturnResult() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -632,10 +530,7 @@ public class CqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslatePrepareStatementExceptions() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -654,10 +549,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslateBindExceptions() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -673,10 +565,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderShouldTranslateExecutionExceptions() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -694,10 +583,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryPreparedStatementCreatorAndBinderAndMapperShouldReturnResult() {
when(preparedStatement.bind()).thenReturn(boundStatement);
@@ -713,10 +599,7 @@ public class CqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldBeEmpty() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(preparedStatement);
@@ -733,10 +616,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(preparedStatement);
@@ -748,10 +628,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementShouldFailReturningManyRecords() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(preparedStatement);
@@ -768,10 +645,7 @@ public class CqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForObjectPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(preparedStatement);
@@ -787,10 +661,7 @@ public class CqlTemplateUnitTests {
assertThat(result).isEqualTo("OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void queryForListPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(preparedStatement);
@@ -806,10 +677,7 @@ public class CqlTemplateUnitTests {
assertThat(result).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-292
- */
- @Test
+ @Test // DATACASS-292
public void updatePreparedStatementShouldReturnApplied() {
when(session.prepare("UPDATE user SET username = ?")).thenReturn(preparedStatement);
@@ -822,7 +690,6 @@ public class CqlTemplateUnitTests {
assertThat(applied).isTrue();
}
-
private void doTestStrings(Integer fetchSize, ConsistencyLevel consistencyLevel,
com.datastax.driver.core.policies.RetryPolicy retryPolicy, Consumer cqlTemplateConsumer) {
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionIntegrationTests.java
index 345e6edcd..998f5b849 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionIntegrationTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@ package org.springframework.cassandra.core;
import static org.assertj.core.api.Assertions.*;
+import reactor.core.publisher.Mono;
+import reactor.core.scheduler.Schedulers;
+
import org.junit.Before;
import org.junit.Test;
import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIntegrationTest;
@@ -26,9 +29,6 @@ import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.exceptions.SyntaxError;
-import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
-
/**
* Integration tests for {@link DefaultBridgedReactiveSession}.
*
@@ -46,10 +46,7 @@ public class DefaultBridgedReactiveSessionIntegrationTests extends AbstractKeysp
this.reactiveSession = new DefaultBridgedReactiveSession(this.session, Schedulers.elastic());
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldExecuteDeferred() throws Exception {
Mono execution = reactiveSession
@@ -64,10 +61,7 @@ public class DefaultBridgedReactiveSessionIntegrationTests extends AbstractKeysp
assertThat(keyspace.getTable("users")).isNotNull();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldTransportExceptionsInMono() throws Exception {
Mono execution = reactiveSession.execute("INSERT INTO dummy;");
@@ -80,10 +74,7 @@ public class DefaultBridgedReactiveSessionIntegrationTests extends AbstractKeysp
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldReturnRows() throws Exception {
session.execute("CREATE TABLE users (\n" + " userid text PRIMARY KEY,\n" + " first_name text\n" + ");");
@@ -97,10 +88,7 @@ public class DefaultBridgedReactiveSessionIntegrationTests extends AbstractKeysp
assertThat(row.getString("userid")).isEqualTo("White");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldPrepareStatement() throws Exception {
session.execute("CREATE TABLE users (\n" + " userid text PRIMARY KEY,\n" + " first_name text\n" + ");");
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionUnitTests.java
index 29ea6d254..95915109b 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/DefaultBridgedReactiveSessionUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@ package org.springframework.cassandra.core;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
+import reactor.core.scheduler.Schedulers;
+
import java.util.Collections;
import org.hamcrest.core.IsEqual;
@@ -33,8 +35,6 @@ import com.datastax.driver.core.Session;
import com.datastax.driver.core.SimpleStatement;
import com.datastax.driver.core.Statement;
-import reactor.core.scheduler.Schedulers;
-
/**
* Unit tests for {@link DefaultBridgedReactiveSession}.
*
@@ -52,10 +52,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
reactiveSession = new DefaultBridgedReactiveSession(sessionMock, Schedulers.immediate());
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeStatementShouldForwardStatementToSession() throws Exception {
SimpleStatement statement = new SimpleStatement("SELECT *");
@@ -64,10 +61,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).executeAsync(statement);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldForwardStatementToSession() throws Exception {
reactiveSession.execute("SELECT *").subscribe();
@@ -75,10 +69,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).executeAsync(eq(new SimpleStatement("SELECT *")));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeWithValuesShouldForwardStatementToSession() throws Exception {
reactiveSession.execute("SELECT * WHERE a = ? and b = ?", "A", "B").subscribe();
@@ -86,10 +77,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).executeAsync(eq(new SimpleStatement("SELECT * WHERE a = ? and b = ?", "A", "B")));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeWithValueMapShouldForwardStatementToSession() throws Exception {
reactiveSession.execute("SELECT * WHERE a = ?", Collections.singletonMap("a", "value")).subscribe();
@@ -98,10 +86,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
.executeAsync(eq(new SimpleStatement("SELECT * WHERE a = ?", Collections.singletonMap("a", "value"))));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void testPrepareQuery() throws Exception {
reactiveSession.prepare("SELECT *").subscribe();
@@ -109,10 +94,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).prepareAsync(eq(new SimpleStatement("SELECT *")));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void testPrepareStatement() throws Exception {
SimpleStatement statement = new SimpleStatement("SELECT *");
@@ -121,10 +103,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).prepareAsync(statement);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void testClose() throws Exception {
reactiveSession.close();
@@ -132,10 +111,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).close();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void testIsClosed() throws Exception {
when(reactiveSession.isClosed()).thenReturn(true);
@@ -146,10 +122,7 @@ public class DefaultBridgedReactiveSessionUnitTests {
verify(sessionMock).isClosed();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void testGetCluster() throws Exception {
Cluster clusterMock = mock(Cluster.class);
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUnitTests.java
index 632e79cf1..a1b8d3307 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,10 +33,7 @@ import com.datastax.driver.core.policies.LoggingRetryPolicy;
*/
public class QueryOptionsUnitTests {
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder() //
@@ -56,10 +53,7 @@ public class QueryOptionsUnitTests {
assertThat(queryOptions.getTracing()).isTrue();
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildQueryOptionsWithDriverRetryPolicy() {
QueryOptions writeOptions = QueryOptions.builder() //
@@ -70,10 +64,7 @@ public class QueryOptionsUnitTests {
assertThat(writeOptions.getDriverRetryPolicy()).isInstanceOf(LoggingRetryPolicy.class);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildQueryOptionsWithRetryPolicy() {
QueryOptions writeOptions = QueryOptions.builder() //
@@ -84,26 +75,17 @@ public class QueryOptionsUnitTests {
assertThat(writeOptions.getDriverRetryPolicy()).isNull();
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void builderShouldRejectSettingOurAndDriverRetryPolicy() {
QueryOptions.builder().retryPolicy(RetryPolicy.DEFAULT).retryPolicy(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void builderShouldRejectSettingDriverAndOurRetryPolicy() {
QueryOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).retryPolicy(RetryPolicy.DEFAULT);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void shouldRejectSettingOurAndDriverRetryPolicy() {
QueryOptions queryOptions = new QueryOptions();
@@ -111,10 +93,7 @@ public class QueryOptionsUnitTests {
queryOptions.setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void shouldRejectSettingDriverAndOurRetryPolicy() {
QueryOptions queryOptions = new QueryOptions();
@@ -122,10 +101,7 @@ public class QueryOptionsUnitTests {
queryOptions.setRetryPolicy(RetryPolicy.DEFAULT);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void shouldRejectSettingOurAndDriverConsistencyLevel() {
QueryOptions queryOptions = new QueryOptions();
@@ -133,10 +109,7 @@ public class QueryOptionsUnitTests {
queryOptions.setConsistencyLevel(ConsistencyLevel.ANY);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void shouldRejectSettingDriverAndOurConsistencyLevel() {
QueryOptions queryOptions = new QueryOptions();
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUtilUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUtilUnitTests.java
index e84b2963d..5ea20f084 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUtilUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/QueryOptionsUtilUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors
+ * Copyright 2016-2017 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,10 +54,7 @@ public class QueryOptionsUtilUnitTests {
@Mock Statement mockStatement;
@Mock Update mockUpdate;
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addPreparedStatementOptionsShouldAddDriverQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder() //
@@ -71,10 +68,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockPreparedStatement).setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addPreparedStatementOptionsShouldAddOurQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder().retryPolicy(RetryPolicy.FALLTHROUGH).build();
@@ -87,10 +81,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockPreparedStatement).setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addStatementQueryOptionsShouldAddDriverQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder().consistencyLevel(ConsistencyLevel.EACH_QUORUM) //
@@ -103,10 +94,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockStatement).setRetryPolicy(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addStatementQueryOptionsShouldAddOurQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder().retryPolicy(RetryPolicy.FALLTHROUGH).build();
@@ -119,10 +107,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockStatement).setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addStatementQueryOptionsShouldNotAddOptions() {
QueryOptions queryOptions = QueryOptions.builder().build();
@@ -132,10 +117,7 @@ public class QueryOptionsUtilUnitTests {
verifyZeroInteractions(mockStatement);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addStatementQueryOptionsShouldAddGenericQueryOptions() {
QueryOptions queryOptions = QueryOptions.builder() //
@@ -151,10 +133,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockStatement).enableTracing();
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addInsertWriteOptionsShouldAddDriverQueryOptions() {
WriteOptions writeOptions = WriteOptions.builder() //
@@ -172,10 +151,7 @@ public class QueryOptionsUtilUnitTests {
verify(mockInsert).using(Mockito.any(Using.class));
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void addUpdateWriteOptionsShouldAddDriverQueryOptions() {
WriteOptions writeOptions = WriteOptions.builder() //
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateIntegrationTests.java
index 791fc96b6..995137b54 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateIntegrationTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@ package org.springframework.cassandra.core;
import static org.assertj.core.api.Assertions.*;
+import reactor.core.scheduler.Schedulers;
+
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -26,8 +28,6 @@ import org.springframework.cassandra.test.integration.AbstractKeyspaceCreatingIn
import com.datastax.driver.core.querybuilder.QueryBuilder;
-import reactor.core.scheduler.Schedulers;
-
/**
* Integration tests for {@link ReactiveCqlTemplate}.
*
@@ -55,10 +55,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
template = new ReactiveCqlTemplate(new DefaultReactiveSessionFactory(reactiveSession));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = 'WHITE'").block();
@@ -66,10 +63,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(getSession().execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user;", String.class).block();
@@ -77,10 +71,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user;").block();
@@ -88,10 +79,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeStatementShouldRemoveRecords() throws Exception {
template.execute(QueryBuilder.delete().from("user").where(QueryBuilder.eq("id", "WHITE"))).block();
@@ -99,10 +87,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(getSession().execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject(QueryBuilder.select("id").from("user"), String.class).block();
@@ -110,10 +95,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldReturnMap() throws Exception {
Map map = template.queryForMap(QueryBuilder.select().from("user")).block();
@@ -121,10 +103,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(map).containsEntry("id", "WHITE").containsEntry("username", "Walter");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeWithArgsShouldRemoveRecords() throws Exception {
template.execute("DELETE FROM user WHERE id = ?", "WHITE").block();
@@ -132,10 +111,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(getSession().execute("SELECT * FROM user").one()).isNull();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectWithArgsShouldReturnFirstColumn() throws Exception {
String id = template.queryForObject("SELECT id FROM user WHERE id = ?;", String.class, "WHITE").block();
@@ -143,10 +119,7 @@ public class ReactiveCqlTemplateIntegrationTests extends AbstractKeyspaceCreatin
assertThat(id).isEqualTo("WHITE");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectWithArgsShouldReturnMap() throws Exception {
Map map = template.queryForMap("SELECT * FROM user WHERE id = ?;", "WHITE").block();
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateUnitTests.java
index 31255f1ab..07e83c900 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/ReactiveCqlTemplateUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@ package org.springframework.cassandra.core;
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
@@ -43,9 +46,6 @@ import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.datastax.driver.core.exceptions.NoHostAvailableException;
import com.datastax.driver.core.policies.DowngradingConsistencyRetryPolicy;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
/**
* Unit tests for {@link ReactiveCqlTemplate}.
*
@@ -75,10 +75,7 @@ public class ReactiveCqlTemplateUnitTests {
// Tests dealing with a plain org.springframework.cassandra.core.ReactiveSession
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCallbackShouldExecuteDeferred() {
Flux flux = template.execute((ReactiveSessionCallback) session -> {
@@ -91,10 +88,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).close();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCallbackShouldTranslateExceptions() {
Flux flux = template.execute((ReactiveSessionCallback) session -> {
@@ -110,10 +104,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlShouldExecuteDeferred() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -125,10 +116,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).execute(any(Statement.class));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -148,10 +136,7 @@ public class ReactiveCqlTemplateUnitTests {
// Tests dealing with static CQL
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -162,10 +147,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, reactiveCqlTemplate -> {
@@ -176,10 +158,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForResultSetShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -193,10 +172,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryWithResultSetExtractorShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -210,10 +186,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryWithResultSetExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, reactiveCqlTemplate -> {
@@ -227,10 +200,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryCqlShouldExecuteDeferred() {
when(reactiveResultSet.wasApplied()).thenReturn(true);
@@ -243,10 +213,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).execute(any(Statement.class));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryCqlShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -262,10 +229,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectCqlShouldBeEmpty() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -275,10 +239,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.hasElement().block()).isFalse();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectCqlShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -288,10 +249,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectCqlShouldReturnNullValue() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -301,10 +259,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.hasElement().block()).isFalse();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectCqlShouldFailReturningManyRecords() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -321,10 +276,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectCqlWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -338,10 +290,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForFluxCqlWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -355,10 +304,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForRowsCqlReturnRows() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -369,10 +315,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).hasSize(2).contains(row);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlShouldReturnWasApplied() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -383,10 +326,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isTrue();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeCqlPublisherShouldReturnWasApplied() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -403,10 +343,7 @@ public class ReactiveCqlTemplateUnitTests {
// Tests dealing with com.datastax.driver.core.Statement
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeStatementShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -417,10 +354,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeStatementWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, reactiveCqlTemplate -> {
@@ -431,10 +365,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForResultStatementSetShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -448,10 +379,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryWithResultSetStatementExtractorShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -466,10 +394,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryWithResultSetStatementExtractorWithArgumentsShouldCallExecution() {
doTestStrings(5, ConsistencyLevel.ONE, DowngradingConsistencyRetryPolicy.INSTANCE, reactiveCqlTemplate -> {
@@ -484,10 +409,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryStatementShouldExecuteDeferred() {
when(reactiveResultSet.wasApplied()).thenReturn(true);
@@ -501,10 +423,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).execute(any(Statement.class));
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryStatementShouldTranslateExceptions() {
when(session.execute(any(Statement.class))).thenThrow(new NoHostAvailableException(Collections.emptyMap()));
@@ -521,10 +440,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldBeEmpty() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -534,10 +450,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.hasElement().block()).isFalse();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -547,10 +460,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldReturnNullValue() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -560,10 +470,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.hasElement().block()).isFalse();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementShouldFailReturningManyRecords() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -580,10 +487,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectStatementWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -597,10 +501,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForFluxStatementWithTypeShouldReturnRecord() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -614,10 +515,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForRowsStatementReturnRows() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -628,10 +526,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).hasSize(2).contains(row);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executeStatementShouldReturnWasApplied() {
when(session.execute(any(Statement.class))).thenReturn(Mono.just(reactiveResultSet));
@@ -646,10 +541,7 @@ public class ReactiveCqlTemplateUnitTests {
// Methods dealing with prepared statements
// -------------------------------------------------------------------------
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryPreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -665,10 +557,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executePreparedStatementWithCallbackShouldCallExecution() {
doTestStrings(null, null, null, reactiveCqlTemplate -> {
@@ -681,10 +570,7 @@ public class ReactiveCqlTemplateUnitTests {
});
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executePreparedStatementCallbackShouldExecuteDeferred() {
when(session.prepare(anyString())).thenReturn(Mono.just(preparedStatement));
@@ -701,10 +587,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).execute(boundStatement);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executePreparedStatementCreatorShouldExecuteDeferred() {
when(session.execute(boundStatement)).thenReturn(Mono.just(reactiveResultSet));
@@ -718,10 +601,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(session).execute(boundStatement);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executePreparedStatementCreatorShouldTranslateStatementCreationExceptions() {
when(session.execute(boundStatement)).thenReturn(Mono.just(reactiveResultSet));
@@ -740,10 +620,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void executePreparedStatementCreatorShouldTranslateStatementCallbackExceptions() {
when(session.execute(boundStatement)).thenReturn(Mono.just(reactiveResultSet));
@@ -762,10 +639,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryPreparedStatementCreatorShouldReturnResult() {
when(session.prepare(anyString())).thenReturn(Mono.just(preparedStatement));
@@ -780,10 +654,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(preparedStatement).bind();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryPreparedStatementCreatorAndBinderShouldReturnResult() {
when(session.prepare(anyString())).thenReturn(Mono.just(preparedStatement));
@@ -801,10 +672,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryPreparedStatementCreatorAndBinderAndMapperShouldReturnResult() {
when(session.prepare(anyString())).thenReturn(Mono.just(preparedStatement));
@@ -822,10 +690,7 @@ public class ReactiveCqlTemplateUnitTests {
verify(preparedStatement).bind("a", "b");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectPreparedStatementShouldBeEmpty() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -838,10 +703,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.hasElement().block()).isFalse();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectPreparedStatementShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -854,10 +716,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectPreparedStatementShouldFailReturningManyRecords() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -876,10 +735,7 @@ public class ReactiveCqlTemplateUnitTests {
}
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForObjectPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -895,10 +751,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isEqualTo("OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForFluxPreparedStatementWithTypeShouldReturnRecord() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -914,10 +767,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).contains("OK", "NOT OK");
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void queryForRowsPreparedStatementReturnRows() {
when(session.prepare("SELECT * FROM user WHERE username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -930,10 +780,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(flux.collectList().block()).hasSize(2).contains(row);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void updatePreparedStatementShouldReturnApplied() {
when(session.prepare("UPDATE user SET username = ?")).thenReturn(Mono.just(preparedStatement));
@@ -946,10 +793,7 @@ public class ReactiveCqlTemplateUnitTests {
assertThat(mono.block()).isTrue();
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void updatePreparedStatementArgsPublisherShouldReturnApplied() {
when(session.prepare("UPDATE user SET username = ?")).thenReturn(Mono.just(preparedStatement));
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/SingleColumnRowMapperUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/SingleColumnRowMapperUnitTests.java
index c22e56eee..c177ad54e 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/SingleColumnRowMapperUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/SingleColumnRowMapperUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,10 +49,7 @@ public class SingleColumnRowMapperUnitTests {
when(row.getColumnDefinitions()).thenReturn(columnDefinitions);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void getColumnValueWithType() {
when(row.getDouble(2)).thenReturn(42d);
@@ -62,10 +59,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.getColumnValue(row, 2, Number.class)).isEqualTo(42d);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void getColumnValue() {
when(row.getObject(2)).thenReturn(42d);
@@ -75,10 +69,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.getColumnValue(row, 2)).isEqualTo(42d);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void convertValueToRequiredTypeForNumber() {
rowMapper = new SingleColumnRowMapper();
@@ -88,10 +79,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.convertValueToRequiredType(1234.2, Double.class)).isEqualTo(1234.2);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void convertValueToRequiredTypeForString() {
rowMapper = new SingleColumnRowMapper();
@@ -100,10 +88,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.convertValueToRequiredType("1234.2", Double.class)).isEqualTo(1234.2);
}
- /**
- * @see DATACASS-335
- */
- @Test(expected = IllegalArgumentException.class)
+ @Test(expected = IllegalArgumentException.class) // DATACASS-335
public void convertValueToRequiredTypeShouldFail() {
rowMapper = new SingleColumnRowMapper<>();
@@ -111,10 +96,7 @@ public class SingleColumnRowMapperUnitTests {
rowMapper.convertValueToRequiredType("1234", Object.class);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void mapRowSingleColumn() {
when(columnDefinitions.size()).thenReturn(1);
@@ -125,10 +107,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.mapRow(row, 2)).isEqualTo(42);
}
- /**
- * @see DATACASS-335
- */
- @Test
+ @Test // DATACASS-335
public void mapRowSingleColumnNullValue() {
when(columnDefinitions.size()).thenReturn(1);
@@ -139,10 +118,7 @@ public class SingleColumnRowMapperUnitTests {
assertThat(rowMapper.mapRow(row, 2)).isNull();
}
- /**
- * @see DATACASS-335
- */
- @Test(expected = TypeMismatchDataAccessException.class)
+ @Test(expected = TypeMismatchDataAccessException.class) // DATACASS-335
public void mapRowSingleColumnWrongType() {
when(columnDefinitions.size()).thenReturn(1);
@@ -153,10 +129,7 @@ public class SingleColumnRowMapperUnitTests {
rowMapper.mapRow(row, 2);
}
- /**
- * @see DATACASS-335
- */
- @Test(expected = IncorrectResultSetColumnCountException.class)
+ @Test(expected = IncorrectResultSetColumnCountException.class) // DATACASS-335
public void tooManyColumns() {
when(columnDefinitions.size()).thenReturn(2);
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/WriteOptionsUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/WriteOptionsUnitTests.java
index 06d74d3c5..e58b01d23 100644
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/WriteOptionsUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/WriteOptionsUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,10 +30,7 @@ import com.datastax.driver.core.policies.FallthroughRetryPolicy;
*/
public class WriteOptionsUnitTests {
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildWriteOptions() {
WriteOptions writeOptions = WriteOptions.builder() //
@@ -54,10 +51,7 @@ public class WriteOptionsUnitTests {
assertThat(writeOptions.getTracing()).isTrue();
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildReadTimeoutOptionsWriteOptions() {
WriteOptions writeOptions = WriteOptions.builder().readTimeout(1, TimeUnit.MINUTES).build();
@@ -67,10 +61,7 @@ public class WriteOptionsUnitTests {
assertThat(writeOptions.getTracing()).isNull();
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildQueryOptionsWithDriverRetryPolicy() {
QueryOptions writeOptions = QueryOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).build();
@@ -79,10 +70,7 @@ public class WriteOptionsUnitTests {
assertThat(writeOptions.getDriverRetryPolicy()).isEqualTo(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test
+ @Test // DATACASS-202
public void buildQueryOptionsWithRetryPolicy() {
QueryOptions writeOptions = QueryOptions.builder().retryPolicy(RetryPolicy.DOWNGRADING_CONSISTENCY).build();
@@ -91,18 +79,12 @@ public class WriteOptionsUnitTests {
assertThat(writeOptions.getDriverRetryPolicy()).isNull();
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void builderShouldRejectSettingOurAndDriverRetryPolicy() {
WriteOptions.builder().retryPolicy(RetryPolicy.DEFAULT).retryPolicy(FallthroughRetryPolicy.INSTANCE);
}
- /**
- * @see DATACASS-202
- */
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalStateException.class) // DATACASS-202
public void builderShouldRejectSettingDriverAndOurRetryPolicy() {
WriteOptions.builder().retryPolicy(FallthroughRetryPolicy.INSTANCE).retryPolicy(RetryPolicy.DEFAULT);
}
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/CqlIdentifierUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/CqlIdentifierUnitTests.java
index 75ba52efb..e8a5c9422 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/CqlIdentifierUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/CqlIdentifierUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractIndexOperationCqlGeneratorTest.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractIndexOperationCqlGeneratorTest.java
index b31499892..6e120d299 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractIndexOperationCqlGeneratorTest.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractIndexOperationCqlGeneratorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractKeyspaceOperationCqlGeneratorTest.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractKeyspaceOperationCqlGeneratorTest.java
index 9ed3e84a0..ad2587573 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractKeyspaceOperationCqlGeneratorTest.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractKeyspaceOperationCqlGeneratorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractTableOperationCqlGeneratorTest.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractTableOperationCqlGeneratorTest.java
index d10b5438e..c2d01a53e 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractTableOperationCqlGeneratorTest.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AbstractTableOperationCqlGeneratorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterKeyspaceCqlGeneratorUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterKeyspaceCqlGeneratorUnitTests.java
index b7cf0a461..37a18e71d 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterKeyspaceCqlGeneratorUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterKeyspaceCqlGeneratorUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorIntegrationTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorIntegrationTests.java
index ed17c5fc0..c2625ecb7 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorIntegrationTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorIntegrationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@ import com.datastax.driver.core.TableMetadata;
* Integration tests tests for {@link AlterTableCqlGenerator}.
*
* @author Mark Paluch
- * @see DATACASS-192
*/
public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCreatingIntegrationTest {
@@ -48,10 +47,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
session.execute("DROP TABLE IF EXISTS users;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAlterColumnType() {
session.execute(
@@ -67,10 +63,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(column.getType()).isEqualTo(DataType.varint());
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAlterListColumnType() {
session.execute(
@@ -86,10 +79,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(column.getType()).isEqualTo((DataType) DataType.list(DataType.varchar()));
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddColumn() {
session.execute(
@@ -105,10 +95,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(column.getType()).isEqualTo(DataType.varchar());
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddListColumn() {
session.execute("CREATE TABLE users (user_name varchar PRIMARY KEY);");
@@ -123,10 +110,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(column.getType()).isEqualTo((DataType) DataType.list(DataType.ascii()));
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableDropColumn() {
session.execute("CREATE TABLE addamsFamily (name varchar PRIMARY KEY, gender varchar);");
@@ -138,10 +122,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(getTableMetadata("addamsfamily").getColumn("gender")).isNull();
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableRenameColumn() {
session.execute("CREATE TABLE addamsFamily (name varchar PRIMARY KEY, firstname varchar);");
@@ -154,10 +135,7 @@ public class AlterTableCqlGeneratorIntegrationTests extends AbstractKeyspaceCrea
assertThat(getTableMetadata("addamsfamily").getColumn("newname")).isNotNull();
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddCaching() {
session.execute("CREATE TABLE users (user_name varchar PRIMARY KEY);");
diff --git a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorUnitTests.java b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorUnitTests.java
index 948f68d10..0c92ea0d4 100755
--- a/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorUnitTests.java
+++ b/spring-cql/src/test/java/org/springframework/cassandra/core/cql/generator/AlterTableCqlGeneratorUnitTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 the original author or authors.
+ * Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,10 +37,7 @@ import com.datastax.driver.core.DataType;
*/
public class AlterTableCqlGeneratorUnitTests {
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAlterColumnType() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").alter("lastKnownLocation",
@@ -49,10 +46,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ALTER lastknownlocation TYPE uuid;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAlterListColumnType() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").alter("lastKnownLocation",
@@ -61,10 +55,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ALTER lastknownlocation TYPE list;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddColumn() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").add("gravesite",
@@ -73,10 +64,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily ADD gravesite varchar;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddListColumn() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("users").add("top_places",
@@ -85,10 +73,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE users ADD top_places list;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableDropColumn() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").drop("gender");
@@ -96,10 +81,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily DROP gender;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableRenameColumn() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily").rename("firstname", "lastname");
@@ -107,10 +89,7 @@ public class AlterTableCqlGeneratorUnitTests {
assertThat(toCql(spec)).isEqualTo("ALTER TABLE addamsfamily RENAME firstname TO lastname;");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddCommentAndTableOption() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily")
@@ -120,10 +99,7 @@ public class AlterTableCqlGeneratorUnitTests {
"ALTER TABLE addamsfamily WITH read_repair_chance = 0.2 AND comment = 'A most excellent and useful table';");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddColumnAndComment() {
AlterTableSpecification spec = AlterTableSpecification.alterTable("addamsFamily")
@@ -134,10 +110,7 @@ public class AlterTableCqlGeneratorUnitTests {
"ALTER TABLE addamsfamily ADD top_places list ADD other list WITH comment = 'A most excellent and useful table';");
}
- /**
- * @see DATACASS-192
- */
- @Test
+ @Test // DATACASS-192
public void alterTableAddCaching() {
Map