1+ /*
2+ *
3+ * *
4+ * * *
5+ * * * * Copyright 2019-2020 the original author or authors.
6+ * * * *
7+ * * * * Licensed under the Apache License, Version 2.0 (the "License");
8+ * * * * you may not use this file except in compliance with the License.
9+ * * * * You may obtain a copy of the License at
10+ * * * *
11+ * * * * https://www.apache.org/licenses/LICENSE-2.0
12+ * * * *
13+ * * * * Unless required by applicable law or agreed to in writing, software
14+ * * * * distributed under the License is distributed on an "AS IS" BASIS,
15+ * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ * * * * See the License for the specific language governing permissions and
17+ * * * * limitations under the License.
18+ * * *
19+ * *
20+ *
21+ *
22+ */
23+
24+ package test .org .springdoc .ui .app34 ;
25+
26+ import org .junit .jupiter .api .Test ;
27+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
28+ import org .springframework .test .context .TestPropertySource ;
29+ import org .springframework .test .web .reactive .server .EntityExchangeResult ;
30+ import test .org .springdoc .ui .AbstractSpringDocTest ;
31+
32+ import static org .junit .jupiter .api .Assertions .assertFalse ;
33+ import static org .junit .jupiter .api .Assertions .assertTrue ;
34+
35+ @ TestPropertySource (properties = "springdoc.swagger-ui.disable-swagger-default-url=true" )
36+ public class SpringDocApp34Test extends AbstractSpringDocTest {
37+
38+ @ Test
39+ void transformed_index_with_oauth () throws Exception {
40+ EntityExchangeResult <byte []> getResult = webTestClient .get ().uri ("/webjars/swagger-ui/swagger-initializer.js" )
41+ .exchange ()
42+ .expectStatus ().isOk ()
43+ .expectBody ().returnResult ();
44+
45+ var responseContent = new String (getResult .getResponseBody ());
46+ assertFalse (responseContent .contains ("https://petstore.swagger.io/v2/swagger.json" ));
47+ assertTrue (responseContent .contains ("/v3/api-docs" ));
48+ }
49+
50+ @ SpringBootApplication
51+ static class SpringDocTestApp {}
52+
53+ }
0 commit comments