Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
9157694f
Commit
9157694f
authored
9 months ago
by
Simon Urli
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-22187: Cannot get revisions with a criteria on a document not stored in DB
* Provide utilities in TestUtils for new integration test
parent
5a454c55
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
+40
-0
40 additions, 0 deletions
...rm-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
with
40 additions
and
0 deletions
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
+
40
−
0
View file @
9157694f
...
...
@@ -1214,6 +1214,46 @@ public String executeWiki(String wikiContent, Syntax wikiSyntax) throws Exceptio
return
executeAndGetBodyAsString
(
reference
,
null
);
}
/**
* @since 16.4.0RC1
* @since 15.10.11
*/
public
String
executeWikiPlain
(
String
wikiContent
,
Syntax
wikiSyntax
)
throws
Exception
{
Map
<
String
,
String
>
queryParameters
=
new
HashMap
<>();
queryParameters
.
put
(
"outputSyntax"
,
"plain"
);
return
executeWiki
(
wikiContent
,
wikiSyntax
,
queryParameters
);
}
/**
* @since 16.4.0RC1
* @since 15.10.11
*/
public
String
executeWiki
(
String
wikiContent
,
Syntax
wikiSyntax
,
Map
<
String
,
String
>
queryParameters
)
throws
Exception
{
LocalDocumentReference
reference
=
new
LocalDocumentReference
(
List
.
of
(
"Test"
,
"Execute"
),
UUID
.
randomUUID
().
toString
());
// Remember the current credentials
UsernamePasswordCredentials
currentCredentials
=
getDefaultCredentials
();
try
{
// Make sure the page is saved with superadmin author
setDefaultCredentials
(
SUPER_ADMIN_CREDENTIALS
);
// Save the page with the content to execute
rest
().
savePage
(
reference
,
wikiContent
,
wikiSyntax
.
toIdString
(),
null
,
null
);
}
finally
{
// Restore initial credentials
setDefaultCredentials
(
currentCredentials
);
}
// Execute the content and return the result
return
executeAndGetBodyAsString
(
reference
,
queryParameters
);
}
/**
* @since 7.2M2
*/
...
...
This diff is collapsed.
Click to expand it.
Simon Urli
@surli
mentioned in commit
e0a9427d
·
7 months ago
mentioned in commit
e0a9427d
mentioned in commit e0a9427d248abb5508c137731aa52c47ff4708f8
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment