File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed
springdoc-openapi-common/src
main/java/org/springdoc/api
test/java/org/springdoc/api
springdoc-openapi-webflux-core/src/test/java/test/org/springdoc/api/app189 Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,8 @@ protected synchronized OpenAPI getOpenApi(Locale locale) {
339339 );
340340 if (!CollectionUtils .isEmpty (openAPI .getServers ()))
341341 openAPIService .setServersPresent (true );
342+ else
343+ openAPIService .setServersPresent (false );
342344 openAPIService .updateServers (openAPI );
343345
344346 if (springDocConfigProperties .isRemoveBrokenReferenceDefinitions ())
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public void setUp() {
120120
121121 when (openAPIService .getContext ()).thenReturn (context );
122122 when (openAPIService .build (any ())).thenReturn (openAPI );
123+ doAnswer (new CallsRealMethods ()).when (openAPIService ).setServersPresent (false );
123124
124125 when (openAPIBuilderObjectFactory .getObject ()).thenReturn (openAPIService );
125126 when (springDocProviders .jsonMapper ()).thenReturn (Json .mapper ());
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ public class SpringDocApp189Test extends AbstractCommonTest {
3434
3535 @ Test
3636 public void testWithDifferentLocales () throws Exception {
37- runTestWithLocale ("en-GB" );
38- runTestWithLocale ("de-DE" );
37+ runTestWithLocale ("en-GB" );
38+ runTestWithLocale ("de-DE" );
3939 }
4040
4141 private void runTestWithLocale (String locale ) throws JSONException {
Original file line number Diff line number Diff line change 2424import io .swagger .v3 .oas .models .info .License ;
2525import io .swagger .v3 .oas .models .security .SecurityScheme ;
2626import org .springdoc .core .customizers .OpenApiCustomiser ;
27- import org .springframework .boot .SpringApplication ;
2827import org .springframework .boot .autoconfigure .SpringBootApplication ;
2928import org .springframework .context .annotation .Bean ;
3029import org .springframework .context .annotation .ComponentScan ;
3130
3231@ SpringBootApplication
3332@ ComponentScan (basePackages = { "org.springdoc" , "test.org.springdoc.api.app189" })
3433public class SpringDocTestApp {
35- public static void main (String [] args ) {
36- SpringApplication .run (SpringDocTestApp .class , args );
37- }
38-
3934 @ Bean
4035 public OpenAPI customOpenAPI () {
4136 return new OpenAPI ()
@@ -51,7 +46,6 @@ OpenApiCustomiser serverUrlCustomizer() {
5146 openApi .getServers ().forEach (server -> {
5247 server .setDescription ("customized description" );
5348 server .setUrl ("https://customized.url" );
54- System .out .println (server );
5549 });
5650 }
5751}
You can’t perform that action at this time.
0 commit comments