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
11fb597d
Commit
11fb597d
authored
3 years ago
by
Michael Hamann
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-19203: The xobjectNumbers from the addedObjects parameter are ignored
* Simplify test case
parent
89203cb7
No related branches found
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-oldcore/src/test/java/com/xpn/xwiki/doc/XWikiDocumentMockitoTest.java
+2
-11
2 additions, 11 deletions
...test/java/com/xpn/xwiki/doc/XWikiDocumentMockitoTest.java
with
2 additions
and
11 deletions
xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/doc/XWikiDocumentMockitoTest.java
+
2
−
11
View file @
11fb597d
...
...
@@ -402,14 +402,11 @@ void readAddedUpdatedAndRemovedObjectsFromForm() throws Exception
mocker
.
registerMockComponent
(
DocumentReferenceResolver
.
TYPE_REFERENCE
,
"current"
);
Map
<
String
,
String
[]>
parameters
=
generateFakeRequestMap
();
parameters
.
put
(
"space.page_32_string"
,
new
String
[]
{
"thirty two"
});
parameters
.
put
(
"space.page_32_int"
,
new
String
[]
{
"32"
});
BaseClass
baseClass
=
generateFakeClass
();
generateFakeObjects
();
EditForm
eform
=
new
EditForm
();
when
(
request
.
getParameter
(
"objectPolicy"
)).
thenReturn
(
"updateOrCreate"
);
when
(
request
.
getParameterValues
(
"addedObjects"
)).
thenReturn
(
new
String
[]
{
"space.page_1"
,
"space.page_32"
});
when
(
request
.
getParameterValues
(
"addedObjects"
)).
thenReturn
(
new
String
[]
{
"space.page_1"
,
"space.page_42"
});
when
(
request
.
getParameterValues
(
"deletedObjects"
)).
thenReturn
(
new
String
[]
{
"space.page_2"
});
when
(
request
.
getParameterMap
()).
thenReturn
(
parameters
);
when
(
documentReferenceResolverString
.
resolve
(
"space.page"
)).
thenReturn
(
this
.
document
.
getDocumentReference
());
...
...
@@ -433,14 +430,8 @@ void readAddedUpdatedAndRemovedObjectsFromForm() throws Exception
assertEquals
(
"string2"
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
1
).
getStringValue
(
"string"
));
assertEquals
(
7
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
1
).
getIntValue
(
"int"
));
assertNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
2
));
assertNotNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
3
));
assertEquals
(
"blabla"
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
3
).
getStringValue
(
"string"
));
assertEquals
(
13
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
3
).
getIntValue
(
"int"
));
assertNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
3
));
assertNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
4
));
assertNotNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
32
));
assertEquals
(
"thirty two"
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
32
).
getStringValue
(
"string"
));
assertEquals
(
32
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
32
).
getIntValue
(
"int"
));
assertNotNull
(
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
42
));
assertEquals
(
"bloublou"
,
this
.
document
.
getXObject
(
baseClass
.
getDocumentReference
(),
42
).
getStringValue
(
"string"
));
...
...
This diff is collapsed.
Click to expand it.
Git Mirror User
@gitmirror
mentioned in commit
69cbdb51
·
3 years ago
mentioned in commit
69cbdb51
mentioned in commit 69cbdb51bba14411db9ee177816f80f7f5162e8f
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