SGF-559 - Configure Geode Integrated Security with annotations.
This commit is contained in:
@@ -205,7 +205,7 @@ public class GemfireTemplateIntegrationTests {
|
||||
public void get() {
|
||||
String key = getKey(getUser("imaPigg"));
|
||||
|
||||
assertThat(usersTemplate.get(key)).isEqualTo(users.get(key));
|
||||
assertThat(usersTemplate.<Object, Object>get(key)).isEqualTo(users.get(key));
|
||||
assertNullEquals(users.get("mrT"), usersTemplate.get("mrT"));
|
||||
}
|
||||
|
||||
@@ -233,11 +233,11 @@ public class GemfireTemplateIntegrationTests {
|
||||
User mandyHandy = users.get(getKey(getUser("mandyHandy")));
|
||||
|
||||
assertThat(mandyHandy).isNotNull();
|
||||
assertThat(usersTemplate.remove(getKey(mandyHandy))).isEqualTo(mandyHandy);
|
||||
assertThat(usersTemplate.<Object, Object>remove(getKey(mandyHandy))).isEqualTo(mandyHandy);
|
||||
assertThat(users.containsKey(getKey(mandyHandy))).isFalse();
|
||||
assertThat(users.containsValue(mandyHandy)).isFalse();
|
||||
assertThat(users.containsKey("loisGriffon")).isFalse();
|
||||
assertThat(usersTemplate.remove("loisGriffon")).isNull();
|
||||
assertThat(usersTemplate.<Object, Object>remove("loisGriffon")).isNull();
|
||||
assertThat(users.containsKey("loisGriffon")).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
|
||||
when(mockQuery.execute(eq(expectedParams))).thenReturn(mockSelectResults);
|
||||
when(mockSelectResults.asList()).thenReturn(Collections.singletonList(1));
|
||||
|
||||
assertThat(template.findUnique(expectedQuery, expectedParams)).isEqualTo(1);
|
||||
assertThat((Object) template.findUnique(expectedQuery, expectedParams)).isEqualTo(1);
|
||||
|
||||
verify(mockRegion, atLeastOnce()).getRegionService();
|
||||
verify(mockRegionService, times(1)).getQueryService();
|
||||
@@ -227,7 +227,7 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
|
||||
|
||||
when(mockQuery.execute(eq(expectedParams))).thenReturn("test");
|
||||
|
||||
assertThat(template.findUnique(expectedQuery, expectedParams)).isEqualTo("test");
|
||||
assertThat((Object) template.findUnique(expectedQuery, expectedParams)).isEqualTo("test");
|
||||
|
||||
verify(mockRegion, atLeastOnce()).getRegionService();
|
||||
verify(mockRegionService, times(1)).getQueryService();
|
||||
@@ -246,7 +246,7 @@ public class GemfireTemplateUnitTests extends AbstractUnitAndIntegrationTestsWit
|
||||
when(mockSelectResults.asList()).thenReturn(Arrays.asList(1, 2));
|
||||
|
||||
try {
|
||||
assertThat(template.findUnique(expectedQuery, expectedParams)).isEqualTo(1);
|
||||
assertThat((Object) template.findUnique(expectedQuery, expectedParams)).isEqualTo(1);
|
||||
}
|
||||
finally {
|
||||
verify(mockRegion, atLeastOnce()).getRegionService();
|
||||
|
||||
@@ -201,8 +201,8 @@ public class AbstractCacheConfigurationUnitTests {
|
||||
MappingPdxSerializer pdxSerializer = cacheConfiguration.newPdxSerializer();
|
||||
|
||||
assertThat(pdxSerializer).isNotNull();
|
||||
assertThat(invokeMethod(pdxSerializer, "getConversionService")).isEqualTo(mockConversionService);
|
||||
assertThat(invokeMethod(pdxSerializer, "getMappingContext")).isEqualTo(mockMappingContext);
|
||||
assertThat((Object) invokeMethod(pdxSerializer, "getConversionService")).isEqualTo(mockConversionService);
|
||||
assertThat((Object) invokeMethod(pdxSerializer, "getMappingContext")).isEqualTo(mockMappingContext);
|
||||
|
||||
verify(mockBeanFactory, times(1)).getConversionService();
|
||||
verifyZeroInteractions(mockConversionService);
|
||||
@@ -216,8 +216,8 @@ public class AbstractCacheConfigurationUnitTests {
|
||||
MappingPdxSerializer pdxSerializer = cacheConfiguration.newPdxSerializer();
|
||||
|
||||
assertThat(pdxSerializer).isNotNull();
|
||||
assertThat(invokeMethod(pdxSerializer, "getConversionService")).isInstanceOf(ConversionService.class);
|
||||
assertThat(invokeMethod(pdxSerializer, "getMappingContext")).isInstanceOf(GemfireMappingContext.class);
|
||||
assertThat((Object) invokeMethod(pdxSerializer, "getConversionService")).isInstanceOf(ConversionService.class);
|
||||
assertThat((Object) invokeMethod(pdxSerializer, "getMappingContext")).isInstanceOf(GemfireMappingContext.class);
|
||||
}
|
||||
|
||||
protected static class TestCacheConfiguration extends AbstractCacheConfiguration {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.gemfire.config.xml;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@@ -114,11 +115,11 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingSpringApplicationCo
|
||||
|
||||
assertNotNull(gatewaySenderFactoryBean);
|
||||
assertNotNull(TestUtils.readField("cache", gatewaySenderFactoryBean));
|
||||
assertEquals(2, TestUtils.readField("remoteDistributedSystemId", gatewaySenderFactoryBean));
|
||||
assertEquals(10, TestUtils.readField("alertThreshold", gatewaySenderFactoryBean));
|
||||
assertThat((Object) TestUtils.readField("remoteDistributedSystemId", gatewaySenderFactoryBean)).isEqualTo(2);
|
||||
assertThat((Object) TestUtils.readField("alertThreshold", gatewaySenderFactoryBean)).isEqualTo(10);
|
||||
assertTrue(Boolean.TRUE.equals(TestUtils.readField("batchConflationEnabled", gatewaySenderFactoryBean)));
|
||||
assertEquals(11, TestUtils.readField("batchSize", gatewaySenderFactoryBean));
|
||||
assertEquals(12, TestUtils.readField("dispatcherThreads", gatewaySenderFactoryBean));
|
||||
assertThat((Object) TestUtils.readField("batchSize", gatewaySenderFactoryBean)).isEqualTo(11);
|
||||
assertThat((Object) TestUtils.readField("dispatcherThreads", gatewaySenderFactoryBean)).isEqualTo(12);
|
||||
assertEquals(false, TestUtils.readField("diskSynchronous", gatewaySenderFactoryBean));
|
||||
assertEquals(true, TestUtils.readField("manualStart", gatewaySenderFactoryBean));
|
||||
|
||||
@@ -190,10 +191,10 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingSpringApplicationCo
|
||||
|
||||
assertNotNull(gatewaySenderFactoryBean);
|
||||
assertNotNull(TestUtils.readField("cache", gatewaySenderFactoryBean));
|
||||
assertEquals(3, TestUtils.readField("remoteDistributedSystemId", gatewaySenderFactoryBean));
|
||||
assertThat((Integer) TestUtils.readField("remoteDistributedSystemId", gatewaySenderFactoryBean)).isEqualTo(3);
|
||||
assertTrue(Boolean.TRUE.equals(TestUtils.readField("batchConflationEnabled", gatewaySenderFactoryBean)));
|
||||
assertEquals(50, TestUtils.readField("batchSize", gatewaySenderFactoryBean));
|
||||
assertEquals(10, TestUtils.readField("dispatcherThreads", gatewaySenderFactoryBean));
|
||||
assertThat((Object) TestUtils.readField("batchSize", gatewaySenderFactoryBean)).isEqualTo(50);
|
||||
assertThat((Object) TestUtils.readField("dispatcherThreads", gatewaySenderFactoryBean)).isEqualTo(10);
|
||||
assertEquals(true, TestUtils.readField("manualStart", gatewaySenderFactoryBean));
|
||||
|
||||
List<GatewayEventFilter> eventFilters = TestUtils.readField("eventFilters", gatewaySenderFactoryBean);
|
||||
|
||||
@@ -16,13 +16,9 @@
|
||||
|
||||
package org.springframework.data.gemfire.function.execution;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.isA;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.isA;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -95,8 +91,8 @@ public class AbstractFunctionExecutionTest {
|
||||
Iterable<Object> actualResults = functionExecution.setFunction(mockFunction)
|
||||
.setArgs(args).setTimeout(500).execute();
|
||||
|
||||
assertThat(actualResults, is(notNullValue()));
|
||||
assertThat(actualResults, is(equalTo((Iterable<Object>) results)));
|
||||
assertThat(actualResults).isNotNull();
|
||||
assertThat(actualResults).isEqualTo((Iterable<Object>) results);
|
||||
|
||||
verify(mockExecution, times(1)).withArgs(eq(args));
|
||||
verify(mockExecution, never()).withCollector(any(ResultCollector.class));
|
||||
@@ -122,7 +118,7 @@ public class AbstractFunctionExecutionTest {
|
||||
}
|
||||
};
|
||||
|
||||
assertThat(String.valueOf(functionExecution.executeAndExtract()), is(equalTo("test")));
|
||||
assertThat(functionExecution.<String>executeAndExtract()).isEqualTo("test");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -140,7 +136,7 @@ public class AbstractFunctionExecutionTest {
|
||||
}
|
||||
};
|
||||
|
||||
assertThat(String.valueOf(functionExecution.executeAndExtract()), is(equalTo("one")));
|
||||
assertThat(functionExecution.<String>executeAndExtract()).isEqualTo("one");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -156,7 +152,7 @@ public class AbstractFunctionExecutionTest {
|
||||
}
|
||||
};
|
||||
|
||||
assertThat(functionExecution.executeAndExtract(), is(nullValue()));
|
||||
assertThat((Object) functionExecution.executeAndExtract()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -172,7 +168,7 @@ public class AbstractFunctionExecutionTest {
|
||||
}
|
||||
};
|
||||
|
||||
assertThat(functionExecution.executeAndExtract(), is(nullValue()));
|
||||
assertThat((Object) functionExecution.executeAndExtract()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -194,5 +190,4 @@ public class AbstractFunctionExecutionTest {
|
||||
|
||||
functionExecution.setFunctionId("TestFunction").executeAndExtract();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,9 +143,9 @@ public class SimpleGemfireRepositoryIntegrationTests {
|
||||
repository.save(Arrays.asList(johnBlum, jonBloom, juanBlume));
|
||||
|
||||
assertThat(template.getRegion().size()).isEqualTo(3);
|
||||
assertThat(template.get(johnBlum.getId())).isEqualTo(johnBlum);
|
||||
assertThat(template.get(jonBloom.getId())).isEqualTo(jonBloom);
|
||||
assertThat(template.get(juanBlume.getId())).isEqualTo(juanBlume);
|
||||
assertThat(template.<Long, Person>get(johnBlum.getId())).isEqualTo(johnBlum);
|
||||
assertThat(template.<Long, Person>get(jonBloom.getId())).isEqualTo(jonBloom);
|
||||
assertThat(template.<Long, Person>get(juanBlume.getId())).isEqualTo(juanBlume);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
||||
@@ -60,13 +60,13 @@ public class ArrayUtilsUnitTests {
|
||||
|
||||
@Test
|
||||
public void getFirstWithNonNullArray() {
|
||||
assertThat(ArrayUtils.getFirst(1, 2, 3)).isEqualTo(1);
|
||||
assertThat(ArrayUtils.getFirst(ArrayUtils.asArray(1, 2, 3))).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getFirstWithNullOrEmptyArrayAndNoDefaultReturnsNull() {
|
||||
assertThat(ArrayUtils.getFirst((Object[]) null)).isNull();
|
||||
assertThat(ArrayUtils.getFirst()).isNull();
|
||||
assertThat((Object) ArrayUtils.getFirst(null)).isNull();
|
||||
assertThat((Object) ArrayUtils.getFirst(new Object[0])).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user