SGF-402 - Polish.

(cherry picked from commit 479bc4e3253425b60d01d1ee4b346d971db3a9e9)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
John Blum
2017-03-29 12:52:20 -07:00
parent 365e8458bf
commit 22ea9702c9
18 changed files with 50 additions and 59 deletions

View File

@@ -105,7 +105,6 @@ public class AbstractSliceSupportTests {
Pageable mockPageable = mock(Pageable.class);
when(mockPageable.previousOrFirst()).thenReturn(mockPageable);
when(mockPageable.hasPrevious()).thenReturn(false);
doReturn(mockPageable).when(mockSlice).previousPageable();
assertThat(mockSlice.getNumber()).isEqualTo(2);
@@ -120,9 +119,7 @@ public class AbstractSliceSupportTests {
Pageable mockPageableTwo = mock(Pageable.class, "Page Two");
when(mockPageableOne.previousOrFirst()).thenReturn(mockPageableOne);
when(mockPageableOne.hasPrevious()).thenReturn(false);
when(mockPageableTwo.previousOrFirst()).thenReturn(mockPageableOne);
when(mockPageableTwo.hasPrevious()).thenReturn(true);
doReturn(mockPageableTwo).when(mockSlice).previousPageable();
assertThat(mockSlice.getNumber()).isEqualTo(3);

View File

@@ -46,7 +46,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.data.gemfire.search.lucene.support.LuceneAccessorSupport;
@@ -60,7 +60,7 @@ import org.springframework.data.gemfire.search.lucene.support.LuceneAccessorSupp
* @see org.mockito.Mock
* @see org.mockito.Mockito
* @see org.mockito.Spy
* @see org.mockito.runners.MockitoJUnitRunner
* @see org.mockito.junit.MockitoJUnitRunner
* @see org.springframework.data.gemfire.search.lucene.LuceneAccessor
* @since 1.0.0
*/

View File

@@ -48,7 +48,7 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -62,7 +62,7 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
* @see org.mockito.Mock
* @see org.mockito.Mockito
* @see org.mockito.Spy
* @see org.mockito.runners.MockitoJUnitRunner
* @see org.mockito.junit.MockitoJUnitRunner
* @see org.springframework.data.gemfire.search.lucene.LuceneIndexFactoryBean
* @since 1.1.0
*/
@@ -95,7 +95,6 @@ public class LuceneIndexFactoryBeanUnitTests {
@Before
public void setup() {
factoryBean = spy(new LuceneIndexFactoryBean());
doReturn(mockLuceneService).when(factoryBean).resolveLuceneService(eq(mockCache));
}
@Test

View File

@@ -86,7 +86,6 @@ public class ProjectingLuceneTemplateUnitTests {
LuceneResultStruct<K, V> mockLuceneResultStruct =
mock(LuceneResultStruct.class, String.format("MockLuceneResultStruct%s", key));
when(mockLuceneResultStruct.getKey()).thenReturn(key);
when(mockLuceneResultStruct.getValue()).thenReturn(value);
return mockLuceneResultStruct;

View File

@@ -75,9 +75,9 @@ public class LucenePageUnitTests {
@SuppressWarnings("unchecked")
protected <K, V> LuceneResultStruct<K, V> mockLuceneResultStruct(K key, V value) {
LuceneResultStruct<K, V> mockLuceneResultStruct = mock(LuceneResultStruct.class);
LuceneResultStruct<K, V> mockLuceneResultStruct = mock(LuceneResultStruct.class,
String.format("MockLuceneResultStruct$%1$s", key));
when(mockLuceneResultStruct.getKey()).thenReturn(key);
when(mockLuceneResultStruct.getValue()).thenReturn(value);
return mockLuceneResultStruct;