From f55609439d86d78038e1915d6c0a849504f653a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Zara?= Date: Wed, 9 Jun 2021 16:35:58 +0200 Subject: [PATCH] LUTECE-2361: Save the current commons include on setup, and restore it on teardown This ensure that the test leaves the system in a known state --- .../lutece/portal/web/template/CommonsTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/fr/paris/lutece/portal/web/template/CommonsTest.java b/src/test/java/fr/paris/lutece/portal/web/template/CommonsTest.java index df92f84516..d7e561511b 100644 --- a/src/test/java/fr/paris/lutece/portal/web/template/CommonsTest.java +++ b/src/test/java/fr/paris/lutece/portal/web/template/CommonsTest.java @@ -59,6 +59,20 @@ public class CommonsTest extends LuteceTestCase { private static final String MARK_FOREIGN_KEYS_LIST = "id_foreigns_list"; private static final String[] CHARTERS_FOLDERS = { "css", "fonts", "js" }; + private CommonsInclude currentCommonsInclude; + + protected void setUp( ) throws Exception + { + super.setUp( ); + currentCommonsInclude = CommonsService.getCurrentCommonsInclude( ); + } + + protected void tearDown( ) throws Exception + { + CommonsService.activateCommons( currentCommonsInclude.getKey( ) ); + super.tearDown( ); + } + @Test public void testCommonsTemplates() throws IOException, TemplateException { String strPath = getClass().getResource(TEMPLATES_FOLDER).getPath();