DATAMONGO-991 - Adapted to deprecation removals in Spring Data Commons.

Related ticket: DATACMNS-469.
This commit is contained in:
Oliver Gierke
2014-07-16 12:04:10 +02:00
parent 9d196b78f7
commit 04870fb8b3
2 changed files with 10 additions and 14 deletions

View File

@@ -27,9 +27,7 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.data.annotation.Id;
import org.springframework.data.auditing.IsNewAwareAuditingHandler;
import org.springframework.data.mapping.context.MappingContextIsNewStrategyFactory;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.support.IsNewStrategyFactory;
/**
* Unit tests for {@link AuditingEventListener}.
@@ -42,16 +40,14 @@ public class AuditingEventListenerUnitTests {
IsNewAwareAuditingHandler handler;
IsNewStrategyFactory factory;
AuditingEventListener listener;
@Before
public void setUp() {
MongoMappingContext mappingContext = new MongoMappingContext();
factory = new MappingContextIsNewStrategyFactory(mappingContext);
handler = spy(new IsNewAwareAuditingHandler(factory));
handler = spy(new IsNewAwareAuditingHandler(mappingContext));
doNothing().when(handler).markCreated(Mockito.any(Object.class));
doNothing().when(handler).markModified(Mockito.any(Object.class));

View File

@@ -618,8 +618,8 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
assertThat(results.getContent().isEmpty(), is(false));
assertThat(results.getNumberOfElements(), is(2));
assertThat(results.isFirstPage(), is(false));
assertThat(results.isLastPage(), is(false));
assertThat(results.isFirst(), is(false));
assertThat(results.isLast(), is(false));
assertThat(results.getAverageDistance().getMetric(), is((Metric) Metrics.KILOMETERS));
assertThat(results.getAverageDistance().getNormalizedValue(), is(0.0));
}
@@ -642,8 +642,8 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
Metrics.KILOMETERS), new PageRequest(1, 2));
assertThat(results.getContent().isEmpty(), is(false));
assertThat(results.getNumberOfElements(), is(1));
assertThat(results.isFirstPage(), is(false));
assertThat(results.isLastPage(), is(true));
assertThat(results.isFirst(), is(false));
assertThat(results.isLast(), is(true));
assertThat(results.getAverageDistance().getMetric(), is((Metric) Metrics.KILOMETERS));
}
@@ -662,8 +662,8 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
assertThat(results.getContent().isEmpty(), is(false));
assertThat(results.getNumberOfElements(), is(1));
assertThat(results.isFirstPage(), is(true));
assertThat(results.isLastPage(), is(true));
assertThat(results.isFirst(), is(true));
assertThat(results.isLast(), is(true));
assertThat(results.getAverageDistance().getMetric(), is((Metric) Metrics.KILOMETERS));
}
@@ -681,8 +681,8 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
assertThat(results.getContent().isEmpty(), is(true));
assertThat(results.getNumberOfElements(), is(0));
assertThat(results.isFirstPage(), is(false));
assertThat(results.isLastPage(), is(true));
assertThat(results.isFirst(), is(false));
assertThat(results.isLast(), is(true));
assertThat(results.getAverageDistance().getMetric(), is((Metric) Metrics.KILOMETERS));
}
@@ -990,7 +990,7 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
assertThat(repository.findOne(QPerson.person.creator.eq(user)), is(dave));
}
/**
* @see DATAMONGO-969
*/