Skip to content

Commit 326e2ec

Browse files
committed
Apply pull request suggestions
1 parent e09257d commit 326e2ec

File tree

23 files changed

+18
-35
lines changed

23 files changed

+18
-35
lines changed

moqu/core/src/main/java/io/quarkiverse/openapi/moqu/marshall/ObjectMapperFactory.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
*/
88
public class ObjectMapperFactory {
99

10-
private static ObjectMapper objectMapper;
10+
private static ObjectMapper objectMapper = new ObjectMapper();
1111

1212
public static ObjectMapper getInstance() {
13-
if (objectMapper == null) {
14-
objectMapper = new ObjectMapper();
15-
}
1613
return objectMapper;
1714
}
1815
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.quarkiverse.openapi.moqu.model;
22

3-
import java.util.Set;
3+
import java.util.List;
44

55
/**
66
* Represents an HTTP header with a name and a set of associated values.
77
*
88
* @param name the name of the HTTP header (e.g., "Accept", "Content-Type").
99
* @param value the set of values associated with the header, allowing multiple values (e.g., "application/json", "text/html").
1010
*/
11-
public record Header(String name, Set<String> value) {
11+
public record Header(String name, List<String> value) {
1212
}

moqu/core/src/main/java/io/quarkiverse/openapi/moqu/model/Request.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.quarkiverse.openapi.moqu.model;
22

3+
import java.util.Collection;
34
import java.util.List;
45

56
/**
@@ -12,5 +13,5 @@
1213
* @param accept the "Accept" header, which specifies the expected response format.
1314
* @param parameters the list of parameters to be included in the request.
1415
*/
15-
public record Request(String url, String httpMethod, String exampleName, Header accept, List<Parameter> parameters) {
16+
public record Request(String url, String httpMethod, String exampleName, Header accept, Collection<Parameter> parameters) {
1617
}

moqu/core/src/test/java/io/quarkiverse/openapi/moqu/OpenAPIMoquImporterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.quarkiverse.openapi.moqu;
22

3-
import static io.quarkiverse.openapi.moqu.Testing.readContentFromFile;
3+
import static io.quarkiverse.openapi.moqu.TestUtils.readContentFromFile;
44

55
import java.util.List;
66
import java.util.Map;

moqu/core/src/test/java/io/quarkiverse/openapi/moqu/Testing.java renamed to moqu/core/src/test/java/io/quarkiverse/openapi/moqu/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.nio.file.Files;
77
import java.nio.file.Path;
88

9-
public class Testing {
9+
public class TestUtils {
1010

1111
public static String readContentFromFile(String resourcePath) {
1212
URL url = Thread.currentThread().getContextClassLoader().getResource((resourcePath));

moqu/core/src/test/java/io/quarkiverse/openapi/moqu/wiremock/mapper/WiremockMapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.quarkiverse.openapi.moqu.wiremock.mapper;
22

3-
import static io.quarkiverse.openapi.moqu.Testing.readContentFromFile;
3+
import static io.quarkiverse.openapi.moqu.TestUtils.readContentFromFile;
44

55
import java.util.List;
66

moqu/core/src/test/java/io/quarkiverse/openapi/moqu/wiremock/mapper/WiremockPathParamTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import io.quarkiverse.openapi.moqu.Moqu;
1111
import io.quarkiverse.openapi.moqu.OpenAPIMoquImporter;
12-
import io.quarkiverse.openapi.moqu.Testing;
12+
import io.quarkiverse.openapi.moqu.TestUtils;
1313
import io.quarkiverse.openapi.moqu.wiremock.model.WiremockMapping;
1414

1515
public class WiremockPathParamTest {
@@ -18,7 +18,7 @@ public class WiremockPathParamTest {
1818
@DisplayName("Should convert a OpenAPI with a single path param correctly")
1919
void shouldMapOneWiremockDefinition() {
2020

21-
String content = Testing.readContentFromFile("wiremock/path_param_one_path_param.yml");
21+
String content = TestUtils.readContentFromFile("wiremock/path_param_one_path_param.yml");
2222
if (content == null) {
2323
Assertions.fail("Was not possible to read the file!");
2424
}
@@ -50,7 +50,7 @@ void shouldMapOneWiremockDefinition() {
5050
@DisplayName("Should convert with a two OpenAPI#paths each one with one path param")
5151
void shouldMapTwoWiremockDefinitions() {
5252

53-
String content = Testing.readContentFromFile("wiremock/path_param_two_params_but_different_path.yml");
53+
String content = TestUtils.readContentFromFile("wiremock/path_param_two_params_but_different_path.yml");
5454
if (content == null) {
5555
Assertions.fail("Was not possible to read the file!");
5656
}
@@ -91,7 +91,7 @@ void shouldMapTwoWiremockDefinitions() {
9191
@DisplayName("Should convert with a combination of path param")
9292
void shouldConvertWithACombinationOfPathParam() {
9393

94-
String content = Testing.readContentFromFile("wiremock/path_param_two_path_params_combination.yml");
94+
String content = TestUtils.readContentFromFile("wiremock/path_param_two_path_params_combination.yml");
9595
if (content == null) {
9696
Assertions.fail("Was not possible to read the file!");
9797
}
@@ -133,7 +133,7 @@ void shouldConvertWithACombinationOfPathParam() {
133133
@DisplayName("Should convert with a combination but only one with example")
134134
void shouldConvertPathParamCombinationOnlyOneWithExample() {
135135

136-
String content = Testing.readContentFromFile("wiremock/path_param_two_path_params_only_one_with_example.yml");
136+
String content = TestUtils.readContentFromFile("wiremock/path_param_two_path_params_only_one_with_example.yml");
137137
if (content == null) {
138138
Assertions.fail("Was not possible to read the file!");
139139
}

moqu/moqu-wiremock/deployment/pom.xml renamed to moqu/deployment/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
<groupId>io.quarkus</groupId>
1818
<artifactId>quarkus-core-deployment</artifactId>
1919
</dependency>
20+
2021
<dependency>
2122
<groupId>io.quarkiverse.openapi.generator</groupId>
2223
<artifactId>quarkus-openapi-generator-moqu-wiremock</artifactId>
2324
<version>${project.version}</version>
2425
</dependency>
26+
2527
<dependency>
2628
<groupId>io.quarkiverse.openapi.generator</groupId>
2729
<artifactId>quarkus-openapi-generator-moqu-core</artifactId>

0 commit comments

Comments
 (0)