1
+ /*
2
+ *
3
+ * * Copyright 2019-2020 the original author or authors.
4
+ * *
5
+ * * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * * you may not use this file except in compliance with the License.
7
+ * * You may obtain a copy of the License at
8
+ * *
9
+ * * https://www.apache.org/licenses/LICENSE-2.0
10
+ * *
11
+ * * Unless required by applicable law or agreed to in writing, software
12
+ * * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * * See the License for the specific language governing permissions and
15
+ * * limitations under the License.
16
+ *
17
+ */
18
+
19
+ package test .org .springdoc .ui .app18 ;
20
+
21
+ import org .junit .jupiter .api .Test ;
22
+ import org .skyscreamer .jsonassert .JSONAssert ;
23
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
24
+ import org .springframework .boot .test .context .SpringBootTest ;
25
+ import test .org .springdoc .ui .AbstractSpringDocActuatorTest ;
26
+
27
+ @ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT ,
28
+ properties = {"management.endpoints.web.exposure.include:*" ,
29
+ "springdoc.use-management-port=true" ,
30
+ "springdoc.swagger-ui.try-it-out-enabled=true" ,
31
+ "management.server.port=9095" ,
32
+ "management.server.base-path=/test" ,
33
+ "management.endpoints.web.base-path=/application"
34
+ })
35
+ class SpringDocApp18Test extends AbstractSpringDocActuatorTest {
36
+
37
+ @ Test
38
+ public void testIndexSwaggerConfigTryItOutEnabledExists () throws Exception {
39
+ String contentAsString = actuatorRestTemplate .getForObject ("/test/application/swaggerui/swagger-config" , String .class );
40
+ String expected = getContent ("results/app18-1.json" );
41
+ JSONAssert .assertEquals (expected , contentAsString , true );
42
+ }
43
+
44
+ @ SpringBootApplication
45
+ static class SpringDocTestApp {
46
+ }
47
+
48
+ }
0 commit comments