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
4a2f3c40
Commit
4a2f3c40
authored
7 years ago
by
Thomas Mortagne
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-14591: Discourage or prevent users to move/rename pages from Extensions
* improve test
parent
4fcb9264
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-api/src/test/java/org/xwiki/refactoring/internal/job/RestoreJobTest.java
+10
-8
10 additions, 8 deletions
...va/org/xwiki/refactoring/internal/job/RestoreJobTest.java
with
10 additions
and
8 deletions
xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-api/src/test/java/org/xwiki/refactoring/internal/job/RestoreJobTest.java
+
10
−
8
View file @
4a2f3c40
...
...
@@ -161,17 +161,19 @@ public void failToExecuteIfNoWikiSpecified() throws Throwable
RestoreRequest
request
=
createRequest
();
request
.
setDeletedDocumentIds
(
Arrays
.
asList
(
deletedDocumentId
));
request
.
setWikiReference
(
null
);
Job
job
=
run
(
request
);
try
{
run
(
request
);
}
catch
(
IllegalArgumentException
actual
)
{
// Verify that the job threw an exception.
Throwable
expected
=
new
IllegalArgumentException
(
"No wiki reference was specified in the job request"
);
assertEquals
(
expected
.
getClass
(),
actual
.
getClass
());
assertEquals
(
expected
.
getMessage
(),
actual
.
getMessage
());
}
// Verify that the document is not restored.
verify
(
this
.
modelBridge
,
never
()).
restoreDeletedDocument
(
deletedDocumentId
,
request
.
isCheckRights
());
// Verify that the job threw an exception.
Throwable
expected
=
new
IllegalArgumentException
(
"No wiki reference was specified in the job request"
);
Throwable
actual
=
job
.
getStatus
().
getError
();
assertNotNull
(
actual
);
assertEquals
(
expected
.
getClass
(),
actual
.
getClass
());
assertEquals
(
expected
.
getMessage
(),
actual
.
getMessage
());
}
private
RestoreRequest
createRequest
()
...
...
This diff is collapsed.
Click to expand it.
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