Skip to content

Commit b25f597

Browse files
committed
SWS-1085 - Enhance to support reuse in a testing environment.
1 parent 16464a6 commit b25f597

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceMessageSender.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
*
3232
* @author Arjen Poutsma
3333
* @author Lukas Krecan
34+
* @author Greg Turnquist
3435
* @since 2.0
3536
*/
36-
class MockWebServiceMessageSender implements WebServiceMessageSender {
37+
public class MockWebServiceMessageSender implements WebServiceMessageSender {
3738

3839
private final List<MockSenderConnection> expectedConnections = new LinkedList<MockSenderConnection>();
3940

@@ -78,4 +79,9 @@ void verifyConnections() {
7879
}
7980
}
8081

82+
void reset() {
83+
expectedConnections.clear();
84+
connectionIterator = null;
85+
}
86+
8187
}

spring-ws-test/src/main/java/org/springframework/ws/test/client/MockWebServiceServer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
*
8989
* @author Arjen Poutsma
9090
* @author Lukas Krecan
91+
* @author Greg Turnquist
9192
* @since 2.0
9293
*/
9394
public class MockWebServiceServer {
@@ -165,15 +166,20 @@ public ResponseActions expect(RequestMatcher requestMatcher) {
165166
}
166167

167168
/**
168-
* Verifies that all expectations were met.
169+
* Verifies that all of the {@link MockWebServiceMessageSender}'s expectations were met.
169170
*
170171
* @throws AssertionError in case of unmet expectations
171172
*/
172173
public void verify() {
173174
mockMessageSender.verifyConnections();
174175
}
175176

176-
177+
/**
178+
* Reset the {@link MockWebServiceMessageSender}'s expectations.
179+
*/
180+
public void reset() {
181+
mockMessageSender.reset();
182+
}
177183

178184

179185
}

0 commit comments

Comments
 (0)