Updated dom4j version because of security warnings.

This commit is contained in:
Ziver Koc 2021-06-21 12:22:03 +02:00
parent 985457be8d
commit e515fd7f87
4 changed files with 141 additions and 136 deletions

View file

@ -11,7 +11,7 @@ repositories {
dependencies {
implementation 'commons-fileupload:commons-fileupload:1.4'
implementation 'commons-io:commons-io:2.7'
implementation 'dom4j:dom4j:1.6.1'
implementation 'org.dom4j:dom4j:2.1.3'
implementation 'org.xerial:sqlite-jdbc:3.8.11.2'
compileOnly 'mysql:mysql-connector-java:8.0.16'

View file

@ -52,9 +52,9 @@
<version>2.7</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>

View file

@ -37,6 +37,6 @@ public class OpenAPIWriterTest {
OpenAPIWriter writer = new OpenAPIWriter(new WebServiceDef(SOAPTest.MainSOAPClass.class));
writer.addServer("example.com", "Main Server");
assertEquals("{\"components\": {\"schemas\": {\"SpecialReturnClass\": {\"type\": \"object\", \"properties\": {\"b\": {\"type\": \"array\", \"items\": {\"format\": \"byte\", \"type\": \"string\"}}, \"otherValue1\": {\"type\": \"string\"}, \"otherName2\": {\"type\": \"string\"}, \"inner\": {\"type\": \"object\", \"properties\": {\"innerClassParam2\": {\"type\": \"string\"}, \"innerClassParam1\": {\"type\": \"string\"}}}}}, \"SimpleReturnClass\": {\"type\": \"object\", \"properties\": {\"otherParam1\": {\"type\": \"string\"}, \"param2\": {\"type\": \"string\"}}}}}, \"servers\": [{\"description\": \"Main Server\", \"url\": \"example.com\"}], \"openapi\": \"3.0.1\", \"paths\": {\"/simpleReturnClassMethod\": {\"get\": {\"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"object\", \"$ref\": \"#/components/schemas/SimpleReturnClass\"}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"byte\", \"required\": true}]}}, \"/exceptionMethod\": {\"get\": {\"description\": \"Documentation of method exceptionMethod()\", \"responses\": {\"200\": {\"description\": \"A successful response.\"}}, \"parameters\": [{\"schema\": {\"type\": \"integer\"}, \"in\": \"query\", \"name\": \"otherParam1\", \"required\": false}, {\"schema\": {\"type\": \"integer\"}, \"in\": \"query\", \"name\": \"otherParam2\", \"required\": false}]}}, \"/specialReturnMethod\": {\"get\": {\"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"$ref\": \"#/components/schemas/SpecialReturnClass\"}}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"StringName2\", \"required\": true}]}}, \"/stringArrayMethod\": {\"get\": {\"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}}}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"StringName\", \"required\": true}]}}, \"/voidMethod\": {\"get\": {\"responses\": {\"200\": {\"description\": \"A successful response.\"}}, \"parameters\": []}}}, \"info\": {\"description\": \"\", \"title\": \"MainSOAPClass\", \"version\": \"\"}}", writer.write());
assertEquals("{\"components\": {\"schemas\": {\"SpecialReturnClass\": {\"type\": \"object\", \"properties\": {\"b\": {\"type\": \"array\", \"items\": {\"format\": \"byte\", \"type\": \"string\"}}, \"otherValue1\": {\"type\": \"string\"}, \"otherName2\": {\"type\": \"string\"}, \"inner\": {\"type\": \"object\", \"properties\": {\"innerClassParam2\": {\"type\": \"string\"}, \"innerClassParam1\": {\"type\": \"string\"}}}}}, \"SimpleReturnClass\": {\"type\": \"object\", \"properties\": {\"otherParam1\": {\"type\": \"string\"}, \"param2\": {\"type\": \"string\"}}}}}, \"servers\": [{\"description\": \"Main Server\", \"url\": \"example.com\"}], \"openapi\": \"3.0.1\", \"paths\": {\"/simpleReturnClassMethod\": {\"get\": {\"description\": \"null is the kala\", \"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"object\", \"$ref\": \"#/components/schemas/SimpleReturnClass\"}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"byte\", \"required\": true}]}}, \"/exceptionMethod\": {\"get\": {\"description\": \"Documentation of method exceptionMethod()\", \"responses\": {\"200\": {\"description\": \"A successful response.\"}}, \"parameters\": [{\"schema\": {\"type\": \"integer\"}, \"in\": \"query\", \"name\": \"otherParam1\", \"required\": false}, {\"schema\": {\"type\": \"integer\"}, \"in\": \"query\", \"name\": \"otherParam2\", \"required\": false}]}}, \"/specialReturnMethod\": {\"get\": {\"description\": \"Documentation of specialReturnMethod()\", \"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"$ref\": \"#/components/schemas/SpecialReturnClass\"}}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"StringName2\", \"required\": true}]}}, \"/stringArrayMethod\": {\"get\": {\"description\": \"Documentation of stringArrayMethod()\", \"responses\": {\"200\": {\"description\": \"A successful response.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}}}}}}}, \"parameters\": [{\"schema\": {\"type\": \"string\"}, \"in\": \"query\", \"name\": \"StringName\", \"required\": true}]}}, \"/voidMethod\": {\"get\": {\"description\": \"void method documentation\", \"responses\": {\"200\": {\"description\": \"A successful response.\"}}, \"parameters\": []}}}, \"info\": {\"description\": \"\", \"title\": \"MainSOAPClass\", \"version\": \"\"}}", writer.write());
}
}

View file

@ -102,11 +102,13 @@ public class WSDLWriterTest {
" </wsdl:message>\n" +
" <wsdl:portType name=\"MainSOAPClassPortType\">\n" +
" <wsdl:operation name=\"stringArrayMethod\">\n" +
" <wsdl:documentation>Documentation of stringArrayMethod()</wsdl:documentation>\n" +
" <wsdl:input message=\"tns:stringArrayMethodRequest\"/>\n" +
" <wsdl:output message=\"tns:stringArrayMethodResponse\"/>\n" +
" <wsdl:fault message=\"tns:exception\"/>\n" +
" </wsdl:operation>\n" +
" <wsdl:operation name=\"simpleReturnClassMethod\">\n" +
" <wsdl:documentation>null is the kala</wsdl:documentation>\n" +
" <wsdl:input message=\"tns:simpleReturnClassMethodRequest\"/>\n" +
" <wsdl:output message=\"tns:simpleReturnClassMethodResponse\"/>\n" +
" <wsdl:fault message=\"tns:exception\"/>\n" +
@ -116,11 +118,14 @@ public class WSDLWriterTest {
" <wsdl:input message=\"tns:exceptionMethodRequest\"/>\n" +
" </wsdl:operation>\n" +
" <wsdl:operation name=\"specialReturnMethod\">\n" +
" <wsdl:documentation>Documentation of specialReturnMethod()</wsdl:documentation>\n" +
" <wsdl:input message=\"tns:specialReturnMethodRequest\"/>\n" +
" <wsdl:output message=\"tns:specialReturnMethodResponse\"/>\n" +
" <wsdl:fault message=\"tns:exception\"/>\n" +
" </wsdl:operation>\n" +
" <wsdl:operation name=\"voidMethod\"/>\n" +
" <wsdl:operation name=\"voidMethod\">\n" +
" <wsdl:documentation>void method documentation</wsdl:documentation>\n" +
" </wsdl:operation>\n" +
" </wsdl:portType>\n" +
" <wsdl:binding name=\"MainSOAPClassBinding\" type=\"tns:MainSOAPClassPortType\">\n" +
" <soap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>\n" +