Skip to content

Commit d90a361

Browse files
committed
Polish Javadoc for @MockStaticEntityMethods & its aspect
1 parent b8ed2f4 commit d90a361

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,29 +17,32 @@
1717
package org.springframework.mock.staticmock;
1818

1919
/**
20-
* Annotation-based aspect to use in test build to enable mocking static methods
21-
* on JPA-annotated {@code @Entity} classes, as used by Roo for finders.
20+
* Annotation-based aspect to use in test builds to enable mocking static methods
21+
* on JPA-annotated {@code @Entity} classes, as used by Spring Roo for finders.
2222
*
2323
* <p>Mocking will occur in the call stack of any method in a class (typically a test class)
24-
* that is annotated with the @MockStaticEntityMethods annotation.
24+
* that is annotated with the {@code @MockStaticEntityMethods} annotation.
2525
*
2626
* <p>Also provides static methods to simplify the programming model for
2727
* entering playback mode and setting expected return values.
2828
*
2929
* <p>Usage:
3030
* <ol>
31-
* <li>Annotate a test class with @MockStaticEntityMethods.
32-
* <li>In each test method, AnnotationDrivenStaticEntityMockingControl will begin in recording mode.
33-
* Invoke static methods on Entity classes, with each recording-mode invocation
34-
* being followed by an invocation to the static expectReturn() or expectThrow()
35-
* method on AnnotationDrivenStaticEntityMockingControl.
36-
* <li>Invoke the static AnnotationDrivenStaticEntityMockingControl() method.
37-
* <li>Call the code you wish to test that uses the static methods. Verification will
38-
* occur automatically.
31+
* <li>Annotate a test class with {@code @MockStaticEntityMethods}.
32+
* <li>In each test method, {@code AnnotationDrivenStaticEntityMockingControl}
33+
* will begin in recording mode.
34+
* <li>Invoke static methods on JPA-annotated {@code @Entity} classes, with each
35+
* recording-mode invocation being followed by an invocation of either the static
36+
* {@link #expectReturn(Object)} method or the static {@link #expectThrow(Throwable)}
37+
* method on {@code AnnotationDrivenStaticEntityMockingControl}.
38+
* <li>Invoke the static {@link #playback()} method.
39+
* <li>Call the code you wish to test that uses the static methods.
40+
* <li>Verification will occur automatically.
3941
* </ol>
4042
*
4143
* @author Rod Johnson
4244
* @author Ramnivas Laddad
45+
* @author Sam Brannen
4346
* @see MockStaticEntityMethods
4447
*/
4548
public aspect AnnotationDrivenStaticEntityMockingControl extends AbstractMethodMockingControl {

spring-aspects/src/main/java/org/springframework/mock/staticmock/MockStaticEntityMethods.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,9 +22,10 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25-
* Annotation to indicate a test class for whose @Test methods
26-
* static methods on Entity classes should be mocked. See
27-
* {@code AbstractMethodMockingControl}.
25+
* Annotation to indicate a test class for whose {code @Test} methods
26+
* static methods on JPA-annotated {@code @Entity} classes should be mocked.
27+
*
28+
* <p>See {@code AnnotationDrivenStaticEntityMockingControl} for details.
2829
*
2930
* @author Rod Johnson
3031
*/

0 commit comments

Comments
 (0)