Skip to content

Commit d1271ab

Browse files
committed
LUT-30657 : LinksInclude tests fixes
1 parent 050a4b4 commit d1271ab

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/test/java/fr/paris/lutece/portal/web/includes/LinksIncludeTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void testGetURICssAddPrefix( )
138138
HttpServletRequest request = new MockHttpServletRequest( );
139139
include.fillTemplate( rootModel, data, nMode, request );
140140
String cssLinks = (String) rootModel.get( "plugins_css_links" );
141-
assertEquals( "<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/style.css\" type=\"text/css\" media=\"screen\" />",
141+
assertEquals( "<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/style.css\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
142142
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
143143
}
144144

@@ -156,7 +156,7 @@ public void testGetURICssAbsoluteHttp( )
156156
HttpServletRequest request = new MockHttpServletRequest( );
157157
include.fillTemplate( rootModel, data, nMode, request );
158158
String cssLinks = (String) rootModel.get( "plugins_css_links" );
159-
assertEquals( "<link rel=\"stylesheet\" href=\"http://example.com/style.css\" type=\"text/css\" media=\"screen\" />",
159+
assertEquals( "<link rel=\"stylesheet\" href=\"http://example.com/style.css\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
160160
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
161161
}
162162

@@ -174,7 +174,7 @@ public void testGetURICssAbsoluteHttps( )
174174
HttpServletRequest request = new MockHttpServletRequest( );
175175
include.fillTemplate( rootModel, data, nMode, request );
176176
String cssLinks = (String) rootModel.get( "plugins_css_links" );
177-
assertEquals( "<link rel=\"stylesheet\" href=\"https://example.com/style.css\" type=\"text/css\" media=\"screen\" />",
177+
assertEquals( "<link rel=\"stylesheet\" href=\"https://example.com/style.css\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
178178
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
179179
}
180180

@@ -192,7 +192,7 @@ public void testGetURICssProtocolRelative( )
192192
HttpServletRequest request = new MockHttpServletRequest( );
193193
include.fillTemplate( rootModel, data, nMode, request );
194194
String cssLinks = (String) rootModel.get( "plugins_css_links" );
195-
assertEquals( "<link rel=\"stylesheet\" href=\"//example.com/style.css\" type=\"text/css\" media=\"screen\" />",
195+
assertEquals( "<link rel=\"stylesheet\" href=\"//example.com/style.css\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
196196
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
197197
}
198198

@@ -242,7 +242,7 @@ public InputStream getResourceAsStream( String path )
242242
include.fillTemplate( rootModel, data, nMode, request );
243243
String cssLinks = (String) rootModel.get( "plugins_css_links" );
244244
assertEquals(
245-
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" media=\"screen\" />",
245+
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
246246
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
247247
try ( FileWriter writer = new FileWriter( hashedFile ) )
248248
{
@@ -259,7 +259,7 @@ public InputStream getResourceAsStream( String path )
259259
{
260260
assertFalse( cssLinks.equals( cssLinks2 ) );
261261
assertEquals(
262-
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=531ba794ef006cd3d69cf1acb33ddeccf8d6c655fb08f469335f8c2c32e2ab68\" type=\"text/css\" media=\"screen\" />",
262+
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=531ba794ef006cd3d69cf1acb33ddeccf8d6c655fb08f469335f8c2c32e2ab68\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
263263
cssLinks2.replace( "\n", "" ).replace( "\r", "" ) );
264264
}
265265
}
@@ -315,7 +315,7 @@ public InputStream getResourceAsStream( String path )
315315
include.fillTemplate( rootModel, data, nMode, request );
316316
String cssLinks = (String) rootModel.get( "plugins_css_links" );
317317
assertEquals(
318-
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?arg=value&lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" media=\"screen\" />",
318+
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?arg=value&lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
319319
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
320320
}
321321
finally
@@ -370,7 +370,7 @@ public int read( ) throws IOException
370370
MockHttpServletRequest request = new MockHttpServletRequest( servletContext );
371371
include.fillTemplate( rootModel, data, nMode, request );
372372
String cssLinks = (String) rootModel.get( "plugins_css_links" );
373-
assertEquals( "<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css\" type=\"text/css\" media=\"screen\" />",
373+
assertEquals( "<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
374374
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
375375
}
376376
finally
@@ -434,7 +434,7 @@ public void close( ) throws IOException
434434
include.fillTemplate( rootModel, data, nMode, request );
435435
String cssLinks = (String) rootModel.get( "plugins_css_links" );
436436
assertEquals(
437-
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" media=\"screen\" />",
437+
"<link rel=\"stylesheet\" href=\"css/plugins/linksIncludeTestPlugin/junithashed.css?lutece_h=88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589\" type=\"text/css\" crossorigin=\"anonymous\" media=\"screen\" />",
438438
cssLinks.replace( "\n", "" ).replace( "\r", "" ) );
439439
}
440440
finally

0 commit comments

Comments
 (0)