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) {
339
339
);
340
340
if (!CollectionUtils .isEmpty (openAPI .getServers ()))
341
341
openAPIService .setServersPresent (true );
342
+ else
343
+ openAPIService .setServersPresent (false );
342
344
openAPIService .updateServers (openAPI );
343
345
344
346
if (springDocConfigProperties .isRemoveBrokenReferenceDefinitions ())
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public void setUp() {
120
120
121
121
when (openAPIService .getContext ()).thenReturn (context );
122
122
when (openAPIService .build (any ())).thenReturn (openAPI );
123
+ doAnswer (new CallsRealMethods ()).when (openAPIService ).setServersPresent (false );
123
124
124
125
when (openAPIBuilderObjectFactory .getObject ()).thenReturn (openAPIService );
125
126
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 {
34
34
35
35
@ Test
36
36
public void testWithDifferentLocales () throws Exception {
37
- runTestWithLocale ("en-GB" );
38
- runTestWithLocale ("de-DE" );
37
+ runTestWithLocale ("en-GB" );
38
+ runTestWithLocale ("de-DE" );
39
39
}
40
40
41
41
private void runTestWithLocale (String locale ) throws JSONException {
Original file line number Diff line number Diff line change 24
24
import io .swagger .v3 .oas .models .info .License ;
25
25
import io .swagger .v3 .oas .models .security .SecurityScheme ;
26
26
import org .springdoc .core .customizers .OpenApiCustomiser ;
27
- import org .springframework .boot .SpringApplication ;
28
27
import org .springframework .boot .autoconfigure .SpringBootApplication ;
29
28
import org .springframework .context .annotation .Bean ;
30
29
import org .springframework .context .annotation .ComponentScan ;
31
30
32
31
@ SpringBootApplication
33
32
@ ComponentScan (basePackages = { "org.springdoc" , "test.org.springdoc.api.app189" })
34
33
public class SpringDocTestApp {
35
- public static void main (String [] args ) {
36
- SpringApplication .run (SpringDocTestApp .class , args );
37
- }
38
-
39
34
@ Bean
40
35
public OpenAPI customOpenAPI () {
41
36
return new OpenAPI ()
@@ -51,7 +46,6 @@ OpenApiCustomiser serverUrlCustomizer() {
51
46
openApi .getServers ().forEach (server -> {
52
47
server .setDescription ("customized description" );
53
48
server .setUrl ("https://customized.url" );
54
- System .out .println (server );
55
49
});
56
50
}
57
51
}
You can’t perform that action at this time.
0 commit comments