Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
auto-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xie.qin
auto-test
Commits
eb27ae45
Commit
eb27ae45
authored
Jul 20, 2021
by
xie.qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed for supporting more sanity tests.
parent
d88f2d46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
OpenApiParser.java
...main/java/com/fuzamei/autotest/openapi/OpenApiParser.java
+12
-7
RestfulMessageEventListener.java
...fuzamei/autotest/openapi/RestfulMessageEventListener.java
+0
-0
No files found.
src/main/java/com/fuzamei/autotest/openapi/OpenApiParser.java
View file @
eb27ae45
...
@@ -343,10 +343,10 @@ public class OpenApiParser {
...
@@ -343,10 +343,10 @@ public class OpenApiParser {
}
}
else
if
(
eachRespNodeSchemaValue
.
has
(
"type"
)
&&
eachRespNodeSchemaValue
.
get
(
"type"
).
asText
().
equalsIgnoreCase
(
"object"
)
&&
eachRespNodeSchemaValue
.
has
(
"additionalProperties"
))
{
else
if
(
eachRespNodeSchemaValue
.
has
(
"type"
)
&&
eachRespNodeSchemaValue
.
get
(
"type"
).
asText
().
equalsIgnoreCase
(
"object"
)
&&
eachRespNodeSchemaValue
.
has
(
"additionalProperties"
))
{
if
(
eachRespNodeSchemaValue
.
get
(
"additionalProperties"
).
has
(
"format"
)){
if
(
eachRespNodeSchemaValue
.
get
(
"additionalProperties"
).
has
(
"format"
)){
respJsonBody
.
put
(
"type"
,
"
array.
object."
+
eachRespNodeSchemaValue
.
get
(
"additionalProperties"
).
get
(
"format"
).
asText
().
toLowerCase
());
respJsonBody
.
put
(
"type"
,
"object."
+
eachRespNodeSchemaValue
.
get
(
"additionalProperties"
).
get
(
"format"
).
asText
().
toLowerCase
());
}
}
else
{
else
{
respJsonBody
.
put
(
"type"
,
"
array.
object."
+
eachRespNodeSchemaValue
.
get
(
"type"
).
asText
().
toLowerCase
());
respJsonBody
.
put
(
"type"
,
"object."
+
eachRespNodeSchemaValue
.
get
(
"type"
).
asText
().
toLowerCase
());
}
}
}
}
else
{
else
{
...
@@ -589,7 +589,8 @@ public class OpenApiParser {
...
@@ -589,7 +589,8 @@ public class OpenApiParser {
if
(
refField
.
equals
(
refKey
)){
if
(
refField
.
equals
(
refKey
)){
Map
<
String
,
String
>
tmpObj
=
new
HashMap
<>();
Map
<
String
,
String
>
tmpObj
=
new
HashMap
<>();
reqJsonBody
.
put
(
property
.
getKey
(),
tmpObj
);
reqJsonBody
.
put
(
property
.
getKey
(),
tmpObj
);
return
reqJsonBody
;
//return reqJsonBody;
break
;
}
}
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
...
@@ -661,7 +662,8 @@ public class OpenApiParser {
...
@@ -661,7 +662,8 @@ public class OpenApiParser {
if
(
refField
.
equals
(
refKey
)){
if
(
refField
.
equals
(
refKey
)){
List
<
String
>
tmpArr
=
new
ArrayList
<>();
List
<
String
>
tmpArr
=
new
ArrayList
<>();
reqJsonBody
.
put
(
property
.
getKey
(),
tmpArr
);
reqJsonBody
.
put
(
property
.
getKey
(),
tmpArr
);
return
reqJsonBody
;
//return reqJsonBody;
break
;
}
}
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
...
@@ -684,7 +686,8 @@ public class OpenApiParser {
...
@@ -684,7 +686,8 @@ public class OpenApiParser {
if
(
refField
.
equals
(
refKey
)){
if
(
refField
.
equals
(
refKey
)){
List
<
String
>
tmpArr
=
new
ArrayList
<>();
List
<
String
>
tmpArr
=
new
ArrayList
<>();
reqJsonBody
.
put
(
property
.
getKey
(),
tmpArr
);
reqJsonBody
.
put
(
property
.
getKey
(),
tmpArr
);
return
reqJsonBody
;
//return reqJsonBody;
break
;
}
}
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
Map
<
String
,
Object
>
subReqJsonBody
=
translatePropertyToJsonBody
(
refField
,
definitionNode
.
get
(
refField
).
get
(
"properties"
),
definitionNode
);
...
@@ -722,7 +725,8 @@ public class OpenApiParser {
...
@@ -722,7 +725,8 @@ public class OpenApiParser {
String
refField
=
property
.
getValue
().
get
(
"additionalProperties"
).
get
(
"originalRef"
).
asText
();
String
refField
=
property
.
getValue
().
get
(
"additionalProperties"
).
get
(
"originalRef"
).
asText
();
if
(
refField
.
equals
(
refKey
)){
if
(
refField
.
equals
(
refKey
)){
respJsonBody
.
put
(
property
.
getKey
(),
"object"
);
respJsonBody
.
put
(
property
.
getKey
(),
"object"
);
return
respJsonBody
;
//return respJsonBody;
break
;
}
}
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
Map
<
String
,
Object
>
objRespJsonBody
=
produceExpectedResponseBody
(
refField
,
definitionNode
.
get
(
refField
),
definitionNode
);
Map
<
String
,
Object
>
objRespJsonBody
=
produceExpectedResponseBody
(
refField
,
definitionNode
.
get
(
refField
),
definitionNode
);
...
@@ -759,7 +763,8 @@ public class OpenApiParser {
...
@@ -759,7 +763,8 @@ public class OpenApiParser {
String
refField
=
property
.
getValue
().
get
(
"items"
).
get
(
"originalRef"
).
asText
();
String
refField
=
property
.
getValue
().
get
(
"items"
).
get
(
"originalRef"
).
asText
();
if
(
refField
.
equals
(
refKey
)){
if
(
refField
.
equals
(
refKey
)){
respJsonBody
.
put
(
property
.
getKey
(),
"array"
);
respJsonBody
.
put
(
property
.
getKey
(),
"array"
);
return
respJsonBody
;
//return respJsonBody;
break
;
}
}
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
if
(
definitionNode
.
has
(
refField
)
&&
definitionNode
.
get
(
refField
).
has
(
"properties"
)){
List
<
Map
<
String
,
Object
>>
tmpArrayObject
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
tmpArrayObject
=
new
ArrayList
<>();
...
...
src/main/java/com/fuzamei/autotest/openapi/RestfulMessageEventListener.java
View file @
eb27ae45
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment