You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-aspects/src/main/java/org/springframework/mock/staticmock/AnnotationDrivenStaticEntityMockingControl.aj
+41-22Lines changed: 41 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2002-2013 the original author or authors.
2
+
* Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -17,50 +17,69 @@
17
17
packageorg.springframework.mock.staticmock;
18
18
19
19
/**
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 of static methods
21
+
* on JPA-annotated {@code @Entity} classes, as used by Spring Roo for so-called
22
+
* <em>finder methods</em>.
22
23
*
23
-
* <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
+
* <p>Mocking will occur within the call stack of any method in a class (typically a
25
+
* test class) that is annotated with {@code @MockStaticEntityMethods}.
25
26
*
26
-
* <p>Also provides static methods to simplify the programming model for
27
-
* entering playback mode and setting expected return values.
27
+
* <p>This aspect also provides static methods to simplify the programming model for
28
+
* setting expectations and entering playback mode.
28
29
*
29
30
* <p>Usage:
30
31
* <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.
32
+
* <li>Annotate a test class with {@code @MockStaticEntityMethods}.
33
+
* <li>In each test method, {@code AnnotationDrivenStaticEntityMockingControl}
34
+
* will begin in <em>recording</em> mode.
35
+
* <li>Invoke static methods on JPA-annotated {@code @Entity} classes, with each
36
+
* recording-mode invocation being followed by an invocation of either the static
37
+
* {@link #expectReturn(Object)} method or the static {@link #expectThrow(Throwable)}
38
+
* method on {@code AnnotationDrivenStaticEntityMockingControl}.
39
+
* <li>Invoke the static {@link #playback()} method.
40
+
* <li>Call the code you wish to test that uses the static methods.
0 commit comments