@@ -50,7 +50,7 @@ void shouldMapOneWiremockDefinition() throws URISyntaxException, IOException {
5050
5151 @ Test
5252 @ DisplayName ("Should convert with a two OpenAPI#paths each one with one path param" )
53- void shouldMapTwoWiremockDefinitions () throws URISyntaxException , IOException {
53+ void shouldMapTwoWiremockDefinitions () {
5454
5555 String content = Testing .readContentFromFile ("wiremock/path_param_two_params_but_different_path.yml" );
5656 if (content == null ) {
@@ -91,7 +91,7 @@ void shouldMapTwoWiremockDefinitions() throws URISyntaxException, IOException {
9191
9292 @ Test
9393 @ DisplayName ("Should convert with a combination of path param" )
94- void shouldConvertWithACombinationOfPathParam () throws URISyntaxException , IOException {
94+ void shouldConvertWithACombinationOfPathParam () {
9595
9696 String content = Testing .readContentFromFile ("wiremock/path_param_two_path_params_combination.yml" );
9797 if (content == null ) {
@@ -131,4 +131,36 @@ void shouldConvertWithACombinationOfPathParam() throws URISyntaxException, IOExc
131131 });
132132 }
133133
134+ @ Test
135+ @ DisplayName ("Should convert with a combination but only one with example" )
136+ void shouldConvertPathParamCombinationOnlyOneWithExample () {
137+
138+ String content = Testing .readContentFromFile ("wiremock/path_param_two_path_params_only_one_with_example.yml" );
139+ if (content == null ) {
140+ Assertions .fail ("Was not possible to read the file!" );
141+ }
142+
143+ OpenAPIQuarkiverseMockImporter importer = new OpenAPIQuarkiverseMockImporter ();
144+
145+ QuarkiverseMock mock = importer .parse (content );
146+
147+ WiremockMapper wiremockMapper = new WiremockMapper ();
148+
149+ List <WiremockDefinition > definitions = wiremockMapper .map (mock );
150+
151+ SoftAssertions .assertSoftly (softly -> {
152+ softly .assertThat (definitions ).hasSize (1 );
153+
154+ softly .assertThat (definitions ).anySatisfy (wiremockDefinition -> {
155+ // request
156+ softly .assertThat (wiremockDefinition .request ().url ()).isEqualTo ("/users/1/books/{bookId}" );
157+ softly .assertThat (wiremockDefinition .request ().method ()).isEqualTo ("GET" );
158+ // response
159+ softly .assertThat (wiremockDefinition .response ().status ()).isEqualTo (200 );
160+ softly .assertThat (wiremockDefinition .response ().body ())
161+ .isEqualTo ("{\" name\" : \" Book for John\" , \" chapters\" : 8}" );
162+ });
163+ });
164+ }
165+
134166}
0 commit comments