Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
formcycle-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
formcycle-plugin
Commits
7a0f8c95
Commit
7a0f8c95
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-5677 improve unit tests
parent
4e0b735c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/de/ozgcloud/formcycle/formdata/FormStructureParserTest.java
+13
-22
13 additions, 22 deletions
.../ozgcloud/formcycle/formdata/FormStructureParserTest.java
with
13 additions
and
22 deletions
src/test/java/de/ozgcloud/formcycle/formdata/FormStructureParserTest.java
+
13
−
22
View file @
7a0f8c95
...
@@ -39,17 +39,6 @@ class FormStructureParserTest {
...
@@ -39,17 +39,6 @@ class FormStructureParserTest {
assertThat
(
result
).
isEmpty
();
assertThat
(
result
).
isEmpty
();
}
}
@Test
void
shouldCallIsInputNode
()
{
try
(
var
itemClassMock
=
mockStatic
(
ItemClass
.
class
))
{
var
items
=
createItem
(
TEXT_FIELD
);
createParser
(
items
).
parse
();
itemClassMock
.
verify
(()
->
ItemClass
.
isInputNode
(
TEXT_FIELD
));
}
}
@Test
@Test
void
shouldCallHandleInputNode
()
{
void
shouldCallHandleInputNode
()
{
var
items
=
createItem
(
TEXT_FIELD
);
var
items
=
createItem
(
TEXT_FIELD
);
...
@@ -58,17 +47,7 @@ class FormStructureParserTest {
...
@@ -58,17 +47,7 @@ class FormStructureParserTest {
structureParser
.
parse
();
structureParser
.
parse
();
verify
(
structureParser
).
handleInputNode
(
items
.
get
(
ITEM_ID
));
verify
(
structureParser
).
handleInputNode
(
items
.
get
(
ITEM_ID
));
}
verify
(
structureParser
,
never
()).
handleContainerNode
(
any
());
@Test
void
shouldCallIsNestedContainer
()
{
try
(
var
itemClassMock
=
mockStatic
(
ItemClass
.
class
))
{
var
items
=
createItem
(
FIELD_SET
);
createParser
(
items
).
parse
();
itemClassMock
.
verify
(()
->
ItemClass
.
isNestedContainer
(
FIELD_SET
));
}
}
}
@Test
@Test
...
@@ -79,6 +58,7 @@ class FormStructureParserTest {
...
@@ -79,6 +58,7 @@ class FormStructureParserTest {
structureParser
.
parse
();
structureParser
.
parse
();
verify
(
structureParser
).
handleContainerNode
(
items
.
get
(
ITEM_ID
));
verify
(
structureParser
).
handleContainerNode
(
items
.
get
(
ITEM_ID
));
verify
(
structureParser
,
never
()).
handleInputNode
(
any
());
}
}
@Test
@Test
...
@@ -101,6 +81,11 @@ class FormStructureParserTest {
...
@@ -101,6 +81,11 @@ class FormStructureParserTest {
@Nested
@Nested
class
TestHandleInputNode
{
class
TestHandleInputNode
{
@BeforeEach
void
init
()
{
structureParser
=
spy
(
new
FormStructureParser
(
createItem
(
FIELD_SET
)));
}
@Test
@Test
void
shouldCallGetResultNodes
()
{
void
shouldCallGetResultNodes
()
{
var
xItem
=
getMock
(
TEXT_FIELD
);
var
xItem
=
getMock
(
TEXT_FIELD
);
...
@@ -258,6 +243,7 @@ class FormStructureParserTest {
...
@@ -258,6 +243,7 @@ class FormStructureParserTest {
@BeforeEach
@BeforeEach
void
init
()
{
void
init
()
{
structureParser
=
spy
(
new
FormStructureParser
(
createItem
(
FIELD_SET
)));
injectResultNodes
(
expectedResultNodes
);
injectResultNodes
(
expectedResultNodes
);
}
}
...
@@ -316,6 +302,11 @@ class FormStructureParserTest {
...
@@ -316,6 +302,11 @@ class FormStructureParserTest {
@Nested
@Nested
class
TestGetNextContainerNode
{
class
TestGetNextContainerNode
{
@BeforeEach
void
init
()
{
structureParser
=
spy
(
new
FormStructureParser
(
createItem
(
FIELD_SET
)));
}
@Test
@Test
void
shouldReturnEmptyWhenNodeStackEmpty
()
{
void
shouldReturnEmptyWhenNodeStackEmpty
()
{
var
nextContainerNode
=
structureParser
.
getNextContainerNode
(
ITEM_ID
);
var
nextContainerNode
=
structureParser
.
getNextContainerNode
(
ITEM_ID
);
...
...
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