diff --git a/pom.xml b/pom.xml
index f69cbbe..f5facd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,10 @@
7.24.0
+ 2.0.1
+ 3.8.5
+ 4.0.6
+ 5.0.2
@@ -101,13 +105,13 @@
io.projectreactor
reactor-test
- 3.8.5
+ ${projectreactor.version}
test
org.wildfly.common
wildfly-common
- 2.0.1
+ ${wildfly-common.version}
test
@@ -120,7 +124,13 @@
org.springframework.boot
spring-boot-starter-test
- 4.0.6
+ ${spring-boot-starter-test.version}
+ test
+
+
+ org.springframework.ws
+ spring-ws-test
+ ${springframework-ws-test.version}
test
@@ -194,5 +204,10 @@
spring-boot-starter-test
test
+
+ org.springframework.ws
+ spring-ws-test
+ test
+
\ No newline at end of file
diff --git a/src/main/resources/META-INF/jqassistant-plugin.xml b/src/main/resources/META-INF/jqassistant-plugin.xml
index 697cbca..90c3232 100644
--- a/src/main/resources/META-INF/jqassistant-plugin.xml
+++ b/src/main/resources/META-INF/jqassistant-plugin.xml
@@ -13,5 +13,6 @@
projectreactor.xml
wildfly-assert.xml
spring-reactive.xml
+ spring-ws.xml
diff --git a/src/main/resources/META-INF/jqassistant-rules/spring-ws.xml b/src/main/resources/META-INF/jqassistant-rules/spring-ws.xml
new file mode 100644
index 0000000..10218dc
--- /dev/null
+++ b/src/main/resources/META-INF/jqassistant-rules/spring-ws.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+ Sets labels :Assert and :Spring:WebService for Spring Web Service assert methods.
+
+ (assertMethod)
+ WHERE
+ assertType.fqn =~ 'org\\.springframework\\.ws\\.test\\.server\\.ResponseActions'
+ AND assertMethod.signature =~ '.* andExpect.*'
+ SET
+ assertMethod:Spring:WebService:Assert
+ RETURN
+ assertMethod
+ ORDER BY
+ assertMethod.signature
+ ]]>
+
+
+
diff --git a/src/test/java/org/jqassistant/plugin/java_testing/concept/AssertExample.java b/src/test/java/org/jqassistant/plugin/java_testing/concept/AssertExample.java
index 31f0aff..7b5bc5c 100644
--- a/src/test/java/org/jqassistant/plugin/java_testing/concept/AssertExample.java
+++ b/src/test/java/org/jqassistant/plugin/java_testing/concept/AssertExample.java
@@ -6,6 +6,10 @@
import org.mockito.BDDMockito;
import org.mockito.MockedStatic;
import org.springframework.test.web.reactive.server.WebTestClient;
+import org.springframework.ws.test.server.MockWebServiceClient;
+import org.springframework.ws.test.server.RequestCreators;
+import org.springframework.ws.test.server.ResponseMatchers;
+import org.springframework.xml.transform.StringSource;
import org.wildfly.common.Assert;
import org.xmlunit.assertj.XmlAssert;
import reactor.test.StepVerifier;
@@ -65,4 +69,10 @@ void springWebTestClientAssertExampleMethod() {
webTestClient.get().exchange().expectStatus().isOk();
}
+ void springWebServiceAssertExampleMethod() {
+ MockWebServiceClient mockWebServiceClient = mock(MockWebServiceClient.class);
+ mockWebServiceClient.sendRequest(RequestCreators.withPayload(new StringSource("")))
+ .andExpect(ResponseMatchers.clientOrSenderFault());
+ }
+
}
\ No newline at end of file
diff --git a/src/test/java/org/jqassistant/plugin/java_testing/concept/SpringWebServiceIT.java b/src/test/java/org/jqassistant/plugin/java_testing/concept/SpringWebServiceIT.java
new file mode 100644
index 0000000..1084c34
--- /dev/null
+++ b/src/test/java/org/jqassistant/plugin/java_testing/concept/SpringWebServiceIT.java
@@ -0,0 +1,81 @@
+package org.jqassistant.plugin.java_testing.concept;
+
+import com.buschmais.jqassistant.core.report.api.model.Column;
+import com.buschmais.jqassistant.core.report.api.model.Result;
+import com.buschmais.jqassistant.core.report.api.model.Row;
+import com.buschmais.jqassistant.core.rule.api.model.Concept;
+import com.buschmais.jqassistant.core.test.plugin.AbstractPluginIT;
+import com.buschmais.jqassistant.plugin.java.api.model.MethodDescriptor;
+import com.buschmais.jqassistant.plugin.java.api.model.TypeDescriptor;
+import com.buschmais.jqassistant.plugin.java.test.AbstractJavaPluginIT;
+import org.junit.jupiter.api.Test;
+import org.springframework.ws.test.server.ResponseActions;
+import org.springframework.ws.test.server.ResponseMatcher;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static com.buschmais.jqassistant.core.report.api.model.Result.Status.SUCCESS;
+import static com.buschmais.jqassistant.plugin.java.test.assertj.MethodDescriptorCondition.methodDescriptor;
+import static com.buschmais.jqassistant.plugin.java.test.assertj.TypeDescriptorCondition.typeDescriptor;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.InstanceOfAssertFactories.type;
+
+public class SpringWebServiceIT extends AbstractJavaPluginIT {
+
+ @Test
+ void springWebServiceAssertMethod() throws Exception {
+ scanClasses(AssertExample.class);
+
+ final Result conceptResult = applyConcept("java-testing-spring-ws:AssertMethod");
+ assertThat(conceptResult.getStatus()).isEqualTo(SUCCESS);
+
+ store.beginTransaction();
+
+ assertThat(conceptResult.getRows().size()).isEqualTo(1);
+ assertThat(conceptResult.getRows()
+ .get(0)
+ .getColumns()
+ .get("assertMethod")
+ .getValue()).asInstanceOf(type(MethodDescriptor.class))
+ .is(methodDescriptor(ResponseActions.class, "andExpect", ResponseMatcher.class));
+
+ verifyResultGraph();
+
+ store.commitTransaction();
+ }
+
+ @Test
+ void providedConceptAssertMethod() throws Exception {
+ scanClasses(AssertExample.class);
+
+ final Result conceptResult = applyConcept("java:AssertMethod");
+ assertThat(conceptResult.getStatus()).isEqualTo(SUCCESS);
+
+ store.beginTransaction();
+
+ final List declaringTypes = conceptResult.getRows().stream()
+ .map(Row::getColumns)
+ .map(columns -> columns.get("DeclaringType"))
+ .map(Column::getValue)
+ .map(TypeDescriptor.class::cast)
+ .collect(Collectors.toList());
+ assertThat(declaringTypes).haveExactly(1, typeDescriptor(ResponseActions.class));
+
+ verifyResultGraph();
+
+ store.commitTransaction();
+ }
+
+ // Expects an open transaction
+ private void verifyResultGraph() throws NoSuchMethodException {
+ final AbstractPluginIT.TestResult methodQueryResult = query(
+ "MATCH (testMethod:Method)-[:INVOKES]->(assertMethod:Method) "
+ + "WHERE assertMethod:Spring:WebService:Assert "
+ + "RETURN testMethod, assertMethod");
+ assertThat(methodQueryResult.getColumn("testMethod"))
+ .haveExactly(1, methodDescriptor(AssertExample.class, "springWebServiceAssertExampleMethod"));
+ assertThat(methodQueryResult.getColumn("assertMethod"))
+ .haveExactly(1, methodDescriptor(ResponseActions.class, "andExpect", ResponseMatcher.class));
+ }
+}