File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
springdoc-openapi-common/src/main/java/org/springdoc/ui
springdoc-openapi-ui/src/test/java/test/org/springdoc/ui/app12 Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 4040 */
4141public class AbstractSwaggerIndexTransformer {
4242
43+ private static final String PRESETS = "presets: [" ;
44+
4345 /**
4446 * The Swagger ui o auth properties.
4547 */
@@ -165,8 +167,8 @@ protected String addCSRF(String html) {
165167 stringBuilder .append ("'] = parts.pop().split(';').shift();\n " );
166168 stringBuilder .append ("return request;\n " );
167169 stringBuilder .append ("},\n " );
168- stringBuilder .append ("presets: [" );
169- return html .replace ("presets: [" , stringBuilder .toString ());
170+ stringBuilder .append (PRESETS );
171+ return html .replace (PRESETS , stringBuilder .toString ());
170172 }
171173
172174 protected String addSyntaxHighlight (String html ) {
@@ -184,8 +186,8 @@ protected String addSyntaxHighlight(String html) {
184186 stringBuilder .append ("\" " );
185187 }
186188 stringBuilder .append ("},\n " );
187- stringBuilder .append ("presets: [" );
188- return html .replace ("presets: [" , stringBuilder .toString ());
189+ stringBuilder .append (PRESETS );
190+ return html .replace (PRESETS , stringBuilder .toString ());
189191 }
190192
191193}
Original file line number Diff line number Diff line change 3232
3333@ TestPropertySource (properties = { "springdoc.swagger-ui.syntaxHighlight.activated=false" ,
3434 "springdoc.swagger-ui.syntaxHighlight.theme=monokai" })
35- public class SpringDocApp12Test extends AbstractSpringDocTest {
35+ class SpringDocApp12Test extends AbstractSpringDocTest {
3636
3737 @ Test
38- public void transformed_index_with_oauth () throws Exception {
38+ void transformed_index_with_oauth () throws Exception {
3939 MvcResult mvcResult = mockMvc .perform (get ("/swagger-ui/index.html" )).andExpect (status ().isOk ()).andReturn ();
4040 String transformedIndex = mvcResult .getResponse ().getContentAsString ();
4141 assertTrue (transformedIndex .contains ("Swagger UI" ));
You can’t perform that action at this time.
0 commit comments