Skip to content

Commit b73ce63

Browse files
Thorsten Schlathoelterbbortt
authored andcommitted
feat(#285): support OpenAPI 3.0 from HttpOperationScenario
1 parent 2810b4d commit b73ce63

File tree

45 files changed

+4094
-1092
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4094
-1092
lines changed

pom.xml

Lines changed: 62 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>org.citrusframework</groupId>
@@ -51,9 +51,12 @@
5151
<name>The Apache License, Version 2.0</name>
5252
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
5353
<distribution>manual</distribution>
54-
<comments>Citrus is published free of charge under Apache License, Version 2.0. You are allowed to use Citrus to test any kind of software
55-
(also commercial applications). If you do this, we kindly ask you to tell us about it so that we can add you to our references
56-
list. You may also use our "Tested using Citrus" logo in your online or printed documentation.</comments>
54+
<comments>Citrus is published free of charge under Apache License, Version 2.0. You are allowed to use
55+
Citrus to test any kind of software
56+
(also commercial applications). If you do this, we kindly ask you to tell us about it so that we can add
57+
you to our references
58+
list. You may also use our "Tested using Citrus" logo in your online or printed documentation.
59+
</comments>
5760
</license>
5861
</licenses>
5962

@@ -402,21 +405,21 @@
402405
<artifactId>maven-gpg-plugin</artifactId>
403406
<version>${maven.gpg.plugin.version}</version>
404407
<executions>
405-
<execution>
406-
<id>sign-artifacts</id>
407-
<phase>verify</phase>
408-
<goals>
409-
<goal>sign</goal>
410-
</goals>
411-
</execution>
408+
<execution>
409+
<id>sign-artifacts</id>
410+
<phase>verify</phase>
411+
<goals>
412+
<goal>sign</goal>
413+
</goals>
414+
</execution>
412415
</executions>
413416
<configuration>
414-
<useAgent>true</useAgent>
415-
<keyname>dev@citrusframework.org</keyname>
416-
<skip>${skip.gpg}</skip>
417-
<gpgArguments>
418-
<arg>--allow-weak-digest-algos</arg>
419-
</gpgArguments>
417+
<useAgent>true</useAgent>
418+
<keyname>dev@citrusframework.org</keyname>
419+
<skip>${skip.gpg}</skip>
420+
<gpgArguments>
421+
<arg>--allow-weak-digest-algos</arg>
422+
</gpgArguments>
420423
</configuration>
421424
</plugin>
422425

@@ -478,48 +481,47 @@
478481
<profiles>
479482
<!-- Distribution Management -->
480483
<profile>
481-
<id>release-central</id>
482-
<build>
483-
<plugins>
484-
<plugin>
485-
<groupId>org.apache.maven.plugins</groupId>
486-
<artifactId>maven-gpg-plugin</artifactId>
487-
</plugin>
488-
489-
<!-- Deploy using the sonatype nexus staging maven plugin -->
490-
<plugin>
491-
<groupId>org.apache.maven.plugins</groupId>
492-
<artifactId>maven-deploy-plugin</artifactId>
493-
<configuration>
494-
<skip>true</skip>
495-
</configuration>
496-
</plugin>
497-
498-
<plugin>
499-
<groupId>org.sonatype.central</groupId>
500-
<artifactId>central-publishing-maven-plugin</artifactId>
501-
<extensions>true</extensions>
502-
<configuration>
503-
<publishingServerId>sonatype-central</publishingServerId>
504-
<excludeArtifacts>
505-
<artifact>citrus-simulator-samples</artifact>
506-
<artifact>citrus-simulator-sample-bank-service</artifact>
507-
<artifact>citrus-simulator-sample-combined</artifact>
508-
<artifact>citrus-simulator-sample-jms</artifact>
509-
<artifact>citrus-simulator-sample-jms-fax</artifact>
510-
<artifact>citrus-simulator-sample-mail</artifact>
511-
<artifact>citrus-simulator-sample-rest</artifact>
512-
<artifact>citrus-simulator-sample-swagger</artifact>
513-
<artifact>citrus-simulator-sample-ws</artifact>
514-
<artifact>citrus-simulator-sample-ws-client</artifact>
515-
<artifact>citrus-simulator-sample-wsdl</artifact>
516-
<artifact>citrus-simulator-docs</artifact>
517-
</excludeArtifacts>
518-
</configuration>
519-
</plugin>
520-
</plugins>
521-
</build>
484+
<id>release-central</id>
485+
<build>
486+
<plugins>
487+
<plugin>
488+
<groupId>org.apache.maven.plugins</groupId>
489+
<artifactId>maven-gpg-plugin</artifactId>
490+
</plugin>
491+
492+
<!-- Deploy using the sonatype nexus staging maven plugin -->
493+
<plugin>
494+
<groupId>org.apache.maven.plugins</groupId>
495+
<artifactId>maven-deploy-plugin</artifactId>
496+
<configuration>
497+
<skip>true</skip>
498+
</configuration>
499+
</plugin>
500+
501+
<plugin>
502+
<groupId>org.sonatype.central</groupId>
503+
<artifactId>central-publishing-maven-plugin</artifactId>
504+
<extensions>true</extensions>
505+
<configuration>
506+
<publishingServerId>sonatype-central</publishingServerId>
507+
<excludeArtifacts>
508+
<artifact>citrus-simulator-samples</artifact>
509+
<artifact>citrus-simulator-sample-bank-service</artifact>
510+
<artifact>citrus-simulator-sample-combined</artifact>
511+
<artifact>citrus-simulator-sample-jms</artifact>
512+
<artifact>citrus-simulator-sample-jms-fax</artifact>
513+
<artifact>citrus-simulator-sample-mail</artifact>
514+
<artifact>citrus-simulator-sample-rest</artifact>
515+
<artifact>citrus-simulator-sample-swagger</artifact>
516+
<artifact>citrus-simulator-sample-ws</artifact>
517+
<artifact>citrus-simulator-sample-ws-client</artifact>
518+
<artifact>citrus-simulator-sample-wsdl</artifact>
519+
<artifact>citrus-simulator-docs</artifact>
520+
</excludeArtifacts>
521+
</configuration>
522+
</plugin>
523+
</plugins>
524+
</build>
522525
</profile>
523-
524526
</profiles>
525527
</project>

simulator-samples/sample-bank-service/src/main/java/org/citrusframework/simulator/sample/config/HttpClientConfig.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
import java.security.NoSuchAlgorithmException;
4242
import java.security.cert.CertificateException;
4343

44+
import static java.lang.String.format;
45+
4446
@Configuration
4547
public class HttpClientConfig {
4648

@@ -62,32 +64,33 @@ public HttpClientConfig(SimulatorConfigurationProperties simulatorConfigurationP
6264
@Bean
6365
public HttpClient simulatorHttpClientEndpoint() {
6466
return CitrusEndpoints.http()
65-
.client()
66-
.timeout(simulatorConfigurationProperties.getDefaultTimeout())
67-
.requestUrl(String.format("https://localhost:%s/", port))
68-
.requestFactory(sslRequestFactory())
69-
.build();
67+
.client()
68+
.timeout(simulatorConfigurationProperties.getDefaultTimeout())
69+
.requestUrl(format("https://localhost:%s/", port))
70+
.requestFactory(sslRequestFactory())
71+
.build();
7072
}
7173

7274
@Bean
7375
public CloseableHttpClient httpClient() {
7476
try {
7577
SSLContext sslcontext = SSLContexts.custom()
76-
.loadTrustMaterial(keyStore, keyStorePassword.toCharArray(),
77-
new TrustSelfSignedStrategy())
78-
.build();
78+
.loadTrustMaterial(keyStore, keyStorePassword.toCharArray(),
79+
new TrustSelfSignedStrategy())
80+
.build();
7981

8082
SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(
81-
sslcontext, NoopHostnameVerifier.INSTANCE);
83+
sslcontext, NoopHostnameVerifier.INSTANCE);
8284

8385
PoolingHttpClientConnectionManager connectionManager = PoolingHttpClientConnectionManagerBuilder.create()
84-
.setSSLSocketFactory(sslSocketFactory)
85-
.build();
86+
.setSSLSocketFactory(sslSocketFactory)
87+
.build();
8688

8789
return HttpClients.custom()
88-
.setConnectionManager(connectionManager)
89-
.build();
90-
} catch (IOException | CertificateException | NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
90+
.setConnectionManager(connectionManager)
91+
.build();
92+
} catch (IOException | CertificateException | NoSuchAlgorithmException | KeyStoreException |
93+
KeyManagementException e) {
9194
throw new BeanCreationException("Failed to create http client for ssl connection", e);
9295
}
9396
}

simulator-samples/sample-combined/src/test/java/org/citrusframework/simulator/EndpointConfig.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
import java.util.Collections;
4242

43+
import static java.lang.String.format;
44+
4345
/**
4446
* @author Christoph Deppisch
4547
*/
@@ -56,14 +58,14 @@ public XsdSchemaRepository schemaRepository() {
5658
@Bean
5759
public HttpClient simulatorRESTClient() {
5860
return CitrusEndpoints.http().client()
59-
.requestUrl(String.format("http://localhost:%s/services/rest/simulator", 8080))
60-
.build();
61+
.requestUrl(format("http://localhost:%s/services/rest/simulator", 8080))
62+
.build();
6163
}
6264

6365
@Bean
6466
public WebServiceClient simulatorWSClient(LoggingClientInterceptor loggingClientInterceptor, SaajSoapMessageFactory messageFactory) {
6567
return CitrusEndpoints.soap().client()
66-
.defaultUri(String.format("http://localhost:%s/services/ws/simulator", 8080))
68+
.defaultUri(format("http://localhost:%s/services/ws/simulator", 8080))
6769
.interceptor(loggingClientInterceptor)
6870
.messageFactory(messageFactory)
6971
.faultStrategy(ErrorHandlingStrategy.PROPAGATE)
@@ -98,11 +100,11 @@ public ActiveMQConnectionFactory connectionFactory() {
98100
@Bean
99101
public JmsSyncEndpoint simulatorEndpoint() {
100102
return CitrusEndpoints.jms()
101-
.synchronous()
102-
.connectionFactory(connectionFactory())
103-
.destination("Citrus.Simulator.Inbound")
104-
.timeout(10000L)
105-
.build();
103+
.synchronous()
104+
.connectionFactory(connectionFactory())
105+
.destination("Citrus.Simulator.Inbound")
106+
.timeout(10000L)
107+
.build();
106108
}
107109

108110
@Bean

0 commit comments

Comments
 (0)