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 40
40
*/
41
41
public class AbstractSwaggerIndexTransformer {
42
42
43
+ private static final String PRESETS = "presets: [" ;
44
+
43
45
/**
44
46
* The Swagger ui o auth properties.
45
47
*/
@@ -165,8 +167,8 @@ protected String addCSRF(String html) {
165
167
stringBuilder .append ("'] = parts.pop().split(';').shift();\n " );
166
168
stringBuilder .append ("return request;\n " );
167
169
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 ());
170
172
}
171
173
172
174
protected String addSyntaxHighlight (String html ) {
@@ -184,8 +186,8 @@ protected String addSyntaxHighlight(String html) {
184
186
stringBuilder .append ("\" " );
185
187
}
186
188
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 ());
189
191
}
190
192
191
193
}
Original file line number Diff line number Diff line change 32
32
33
33
@ TestPropertySource (properties = { "springdoc.swagger-ui.syntaxHighlight.activated=false" ,
34
34
"springdoc.swagger-ui.syntaxHighlight.theme=monokai" })
35
- public class SpringDocApp12Test extends AbstractSpringDocTest {
35
+ class SpringDocApp12Test extends AbstractSpringDocTest {
36
36
37
37
@ Test
38
- public void transformed_index_with_oauth () throws Exception {
38
+ void transformed_index_with_oauth () throws Exception {
39
39
MvcResult mvcResult = mockMvc .perform (get ("/swagger-ui/index.html" )).andExpect (status ().isOk ()).andReturn ();
40
40
String transformedIndex = mvcResult .getResponse ().getContentAsString ();
41
41
assertTrue (transformedIndex .contains ("Swagger UI" ));
You can’t perform that action at this time.
0 commit comments