Browse Source

DATACMNS-414 - Adapted to removed generics in AuditingHandler API.

pull/82/merge
Oliver Gierke 12 years ago
parent
commit
e9c8644d23
  1. 6
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEventListener.java
  2. 9
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/event/AuditingEventListenerUnitTests.java

6
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/AuditingEventListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2014 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.
@ -28,14 +28,14 @@ import org.springframework.util.Assert; @@ -28,14 +28,14 @@ import org.springframework.util.Assert;
*/
public class AuditingEventListener implements ApplicationListener<BeforeConvertEvent<Object>> {
private final IsNewAwareAuditingHandler<Object> auditingHandler;
private final IsNewAwareAuditingHandler auditingHandler;
/**
* Creates a new {@link AuditingEventListener} using the given {@link MappingContext} and {@link AuditingHandler}.
*
* @param auditingHandler must not be {@literal null}.
*/
public AuditingEventListener(IsNewAwareAuditingHandler<Object> auditingHandler) {
public AuditingEventListener(IsNewAwareAuditingHandler auditingHandler) {
Assert.notNull(auditingHandler, "IsNewAwareAuditingHandler must not be null!");
this.auditingHandler = auditingHandler;

9
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/event/AuditingEventListenerUnitTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2014 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,7 @@ import org.springframework.data.support.IsNewStrategyFactory; @@ -37,7 +37,7 @@ import org.springframework.data.support.IsNewStrategyFactory;
@RunWith(MockitoJUnitRunner.class)
public class AuditingEventListenerUnitTests {
IsNewAwareAuditingHandler<Object> handler;
IsNewAwareAuditingHandler handler;
IsNewStrategyFactory factory;
AuditingEventListener listener;
@ -48,7 +48,7 @@ public class AuditingEventListenerUnitTests { @@ -48,7 +48,7 @@ public class AuditingEventListenerUnitTests {
MongoMappingContext mappingContext = new MongoMappingContext();
factory = new MappingContextIsNewStrategyFactory(mappingContext);
handler = spy(new IsNewAwareAuditingHandler<Object>(factory));
handler = spy(new IsNewAwareAuditingHandler(factory));
doNothing().when(handler).markCreated(Mockito.any(Object.class));
doNothing().when(handler).markModified(Mockito.any(Object.class));
@ -83,7 +83,6 @@ public class AuditingEventListenerUnitTests { @@ -83,7 +83,6 @@ public class AuditingEventListenerUnitTests {
static class Sample {
@Id
String id;
@Id String id;
}
}

Loading…
Cancel
Save