Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/1175/improve open api final 2 #1224

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fbb5aa0
fix(#1175): OpenAPI connector enhancements for simulator random messa…
Jun 11, 2024
c61d53e
fix(#1175): OpenAPI connector enhancements for simulator random messa…
Jun 11, 2024
d5d68fe
feat(#1175): Add OpenApiRepository and Validation
Jun 21, 2024
c89f479
chore(#1175): minor adjustments on imports and code style
bbortt Jun 24, 2024
d805b99
feat(#1175): Add OpenApiRepository and Validation
Jun 25, 2024
9ad768c
feat(#1175): improve random data generation for test data generator
Jul 5, 2024
e25f59d
feat(#1175): added random generator framework
Jul 7, 2024
0de512a
feat(#1156): provide test api generator
May 13, 2024
5f0d870
chore: remove author annotations
May 21, 2024
8073b06
chore: add license to new files
May 21, 2024
c6aff8e
chore: cleanup generator tests
Jun 5, 2024
20f90b0
chore: improve OpenApi example
Jun 5, 2024
ddfdb1d
ci: connect openapi generator to maven reactor
bbortt Jul 2, 2024
679fc68
feat(#1156): generate Java models alongside citrus classes
bbortt Jul 3, 2024
9c38674
new api generation
Jul 21, 2024
96477ed
feat(#1175): adds open api validation by standard citrus schema valid…
Jul 21, 2024
99ead8c
feat: improve open api generator
Sep 29, 2024
c5e9bb2
fix: pom structure
bbortt Oct 15, 2024
8d0b58c
chore(citrus-openapi): review and code cleanup
bbortt Oct 21, 2024
6ff63ba
chore(citrus-api): review and code cleanup
bbortt Oct 23, 2024
541231f
chore(citrus-base): review and code cleanup
bbortt Oct 24, 2024
e1fa672
chore(citrus-spring): review and code cleanup
bbortt Oct 24, 2024
47d89b2
chore(citrus-http): review and code cleanup
bbortt Oct 24, 2024
496f074
chore(citrus-jms): review and code cleanup
bbortt Oct 24, 2024
813b407
chore(citrus-rmi): review and code cleanup
bbortt Oct 24, 2024
51b2d25
docs(#1175): review
bbortt Oct 24, 2024
ba6fa33
chore(citrus-test-api-core): review and code cleanup
bbortt Oct 26, 2024
15b5f9b
chore(citrus-test-api-generator-core): review and code cleanup
bbortt Oct 28, 2024
7c98a84
chore(citrus-test-api-generator-maven-plugin): review and code cleanup
bbortt Oct 28, 2024
4856c9b
chore(citrus-test-api-spring): review and code cleanup
bbortt Oct 28, 2024
9e1f8ad
chore(citrus-validation): review and code cleanup
bbortt Oct 28, 2024
0b9cf12
ci: fix citrus java codegen test with root folder
bbortt Oct 28, 2024
40db0f9
feat: changes on open api feature due to first beta tests
Nov 22, 2024
4952226
chore: bump maven reactor to 4.5.0-SNAPSHOT
bbortt Nov 24, 2024
bb1c5d5
feat: changes on open api feature due to first beta tests
Nov 25, 2024
6619f23
feat: changes on open api feature due to first beta tests
Dec 5, 2024
bae7bfc
chore(deps): remove duplicate spring.version declaration
bbortt Dec 10, 2024
1c29c58
feat: add option to specify OpenApiValidationPolicy
Dec 11, 2024
5458925
chore: fix test errors
Dec 12, 2024
1a20729
fix: throwsException strategy throws stack overflow exception
Dec 12, 2024
f5282b1
fix: accept only json and plain text for random message generation
Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION := 4.4.0-SNAPSHOT
VERSION := 4.5.0-SNAPSHOT
RELEASE_GIT_REMOTE := origin
GIT_COMMIT := $(shell git rev-list -1 HEAD)

Expand Down
15 changes: 15 additions & 0 deletions catalog/citrus-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,21 @@
<artifactId>citrus-openapi</artifactId>
<version>4.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-core</artifactId>
<version>4.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-generator-core</artifactId>
<version>4.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-test-api-spring</artifactId>
<version>4.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-jms</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@
import org.citrusframework.jbang.UnitTestSupport;
import org.citrusframework.spi.Resource;
import org.citrusframework.spi.Resources;
import org.citrusframework.util.TestUtils;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangActionTest extends UnitTestSupport {

private final Resource helloScript = Resources.fromClasspath("org/citrusframework/jbang/hello.java");

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void testScriptOrFile() {
JBangAction jbang = new JBangAction.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@
import org.citrusframework.TestCase;
import org.citrusframework.TestCaseMetaInfo;
import org.citrusframework.jbang.actions.JBangAction;
import org.citrusframework.util.TestUtils;
import org.citrusframework.xml.XmlTestLoader;
import org.citrusframework.xml.actions.XmlTestActionBuilder;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangTest extends AbstractXmlActionTest {

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void shouldLoadJBangActions() {
XmlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/xml/jbang-test.xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@
import org.citrusframework.TestCase;
import org.citrusframework.TestCaseMetaInfo;
import org.citrusframework.jbang.actions.JBangAction;
import org.citrusframework.util.TestUtils;
import org.citrusframework.yaml.YamlTestLoader;
import org.citrusframework.yaml.actions.YamlTestActionBuilder;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class JBangTest extends AbstractYamlActionTest {

@BeforeClass
public static void beforeEach() {
if (!TestUtils.isNetworkReachable()) {
throw new SkipException("Test skipped because network is not reachable. We are probably running behind a proxy and JBang download is not possible.");
}
}

@Test
public void shouldLoadJBangActions() {
YamlTestLoader testLoader = createTestLoader("classpath:org/citrusframework/jbang/yaml/jbang-test.yaml");
Expand Down
6 changes: 6 additions & 0 deletions connectors/citrus-openapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// TODO
OpenApiServerRequest
- SchemaValidation is active by default (also in other scenarios)

Oas Validation now by ValidationFramework
- no control response message is created any more
10 changes: 9 additions & 1 deletion connectors/citrus-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-data-models</artifactId>
</dependency>
<dependency>
<groupId>com.atlassian.oai</groupId>
<artifactId>swagger-request-validator-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.17.0</version>
</dependency>

<!-- Test scoped dependencies -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

/**
* Enum representing different types of auto-fill behavior for OpenAPI parameters/body.
* This enum defines how missing or required parameters/body should be auto-filled.
*/
public enum AutoFillType {
/**
* No auto-fill will be performed for any parameters/body.
*/
NONE,

/**
* Auto-fill will be applied only to required parameters/body that are missing.
*/
REQUIRED,

/**
* Auto-fill will be applied to all parameters/body, whether they are required or not.
*/
ALL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.citrusframework.openapi;

public final class OpenApiConstants {

public static final String TYPE_ARRAY = "array";
public static final String TYPE_BOOLEAN = "boolean";
public static final String TYPE_INTEGER = "integer";
public static final String TYPE_NUMBER = "number";
public static final String TYPE_OBJECT = "object";
public static final String TYPE_STRING = "string";

public static final String FORMAT_INT32 = "int32";
public static final String FORMAT_INT64 = "int64";
public static final String FORMAT_FLOAT = "float";
public static final String FORMAT_DOUBLE = "double";
public static final String FORMAT_DATE = "date";
public static final String FORMAT_DATE_TIME = "date-time";
public static final String FORMAT_UUID = "uuid";

/**
* Prevent instantiation.
*/
private OpenApiConstants() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

import org.citrusframework.message.MessageHeaders;

public class OpenApiMessageHeaders {

public static final String OAS_PREFIX = MessageHeaders.PREFIX + "oas_";

public static final String OAS_UNIQUE_OPERATION_ID = OAS_PREFIX + "unique_operation_id";

public static final String OAS_SPECIFICATION_ID = OAS_PREFIX + "unique_specification_id";

public static final String OAS_MESSAGE_TYPE = OAS_PREFIX + "message_type";

public static final String RESPONSE_TYPE = OAS_PREFIX + "response";

public static final String REQUEST_TYPE = OAS_PREFIX + "request";

private OpenApiMessageHeaders() {
// Static access only
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.citrusframework.openapi;

/**
* The {@code OpenApiMessageType} enum defines the types of OpenAPI messages,
* specifically REQUEST and RESPONSE. Each type is associated with a specific
* header name, which is used to identify the type of message in the OpenAPI
* message headers.
*/
public enum OpenApiMessageType {

REQUEST(OpenApiMessageHeaders.REQUEST_TYPE), RESPONSE(OpenApiMessageHeaders.RESPONSE_TYPE);

private final String headerName;

OpenApiMessageType(String headerName) {
this.headerName = headerName;
}

public String toHeaderName() {
return headerName;
}
}
Loading