Skip to content
Snippets Groups Projects
Commit 499f45d8 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

[Misc] Improve test

(cherry picked from commit d53d6e34)
parent 8607d3dc
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,13 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.template.TemplateManager;
import org.xwiki.test.page.PageTest;
import org.xwiki.velocity.VelocityManager;
import com.xpn.xwiki.XWikiException;
import com.xpn.xwiki.doc.XWikiDocument;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
......@@ -60,17 +62,20 @@ class CreateInlinePageTest extends PageTest
private static final String ERROR_MESSAGE_CLASS = "errormessage";
@Inject
private VelocityManager velocityManager;
@Inject
private TemplateManager templateManager;
@BeforeEach
void setup() throws Exception
void setup()
{
this.velocityManager = this.oldcore.getMocker().getInstance(VelocityManager.class);
// Set an empty list of recommended template providers to avoid a Velocity error.
this.velocityManager.getVelocityContext().put("recommendedTemplateProviders", List.of());
// Set a context document to avoid problems
this.oldcore.getXWikiContext().setDoc(new XWikiDocument(new DocumentReference("xwiki", "space", "page")));
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment