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
b61e0c2d
Commit
b61e0c2d
authored
Sep 17, 2021
by
xie.qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To support services separately deploy.
parent
0d1d56d5
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
869 additions
and
63 deletions
+869
-63
build.gradle
api/build.gradle
+21
-12
sanity.feature
...urces/features/apitest/restful/app-service/sanity.feature
+7
-0
sanity.feature
...rces/features/apitest/restful/auth-service/sanity.feature
+7
-0
sanity.feature
...ces/features/apitest/restful/chain-service/sanity.feature
+7
-0
sanity.feature
...ces/features/apitest/restful/cloud-service/sanity.feature
+7
-0
sanity.feature
...features/apitest/restful/commodity-service/sanity.feature
+7
-0
sanity.feature
...es/features/apitest/restful/common-service/sanity.feature
+7
-0
sanity.feature
...s/features/apitest/restful/license-service/sanity.feature
+7
-0
sanity.feature
...es/features/apitest/restful/logger-service/sanity.feature
+7
-0
sanity.feature
...s/features/apitest/restful/monitor-service/sanity.feature
+7
-0
sanity.feature
...ces/features/apitest/restful/order-service/sanity.feature
+7
-0
sanity.feature
...urces/features/apitest/restful/pay-service/sanity.feature
+7
-0
sanity.feature
...rces/features/apitest/restful/user-service/sanity.feature
+7
-0
user_register.feature
...atures/apitest/restful/user-service/user_register.feature
+0
-0
sanity.feature
...s/features/apitest/restful/website-service/sanity.feature
+7
-0
backend.feature
api/resources/features/sanitytest/backend.feature
+3
-3
backendOpenAPI.json
api/resources/testingdata/v2.3.0/openapi/backendOpenAPI.json
+0
-0
OpenApiParser.java
...main/java/com/fuzamei/autotest/openapi/OpenApiParser.java
+303
-24
GlobalProperties.java
...ava/com/fuzamei/autotest/properties/GlobalProperties.java
+4
-1
AppServiceProperties.java
...ei/autotest/properties/services/AppServiceProperties.java
+24
-0
AuthServiceProperties.java
...i/autotest/properties/services/AuthServiceProperties.java
+24
-0
ChainServiceProperties.java
.../autotest/properties/services/ChainServiceProperties.java
+24
-0
CloudServiceProperties.java
.../autotest/properties/services/CloudServiceProperties.java
+24
-0
CommodityServiceProperties.java
...otest/properties/services/CommodityServiceProperties.java
+24
-0
CommonServiceProperties.java
...autotest/properties/services/CommonServiceProperties.java
+24
-0
LicenseServiceProperties.java
...utotest/properties/services/LicenseServiceProperties.java
+24
-0
LoggerServiceProperties.java
...autotest/properties/services/LoggerServiceProperties.java
+24
-0
MonitorServiceProperties.java
...utotest/properties/services/MonitorServiceProperties.java
+24
-0
OrderServiceProperties.java
.../autotest/properties/services/OrderServiceProperties.java
+24
-0
PayServiceProperties.java
...ei/autotest/properties/services/PayServiceProperties.java
+24
-0
UserServiceProperties.java
...i/autotest/properties/services/UserServiceProperties.java
+24
-0
WebsiteServiceProperties.java
...utotest/properties/services/WebsiteServiceProperties.java
+24
-0
application.yml
api/src/main/resources/application.yml
+108
-2
logback-spring.xml
api/src/main/resources/logback-spring.xml
+4
-4
ApiVerification.java
...a/com/fuzamei/autotest/steps/openapi/ApiVerification.java
+23
-17
No files found.
api/build.gradle
View file @
b61e0c2d
...
@@ -2,9 +2,9 @@ plugins {
...
@@ -2,9 +2,9 @@ plugins {
id
'org.springframework.boot'
version
'2.5.1'
id
'org.springframework.boot'
version
'2.5.1'
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
id
'java'
id
'java'
id
'io.qameta.allure'
version
'2.8.1'
id
"com.google.protobuf"
version
"0.8.17"
id
"com.google.protobuf"
version
"0.8.17"
id
'idea'
id
'idea'
id
'io.qameta.allure'
version
'2.8.1'
}
}
group
=
'com.fuzamei'
group
=
'com.fuzamei'
...
@@ -26,6 +26,11 @@ repositories {
...
@@ -26,6 +26,11 @@ repositories {
jcenter
()
jcenter
()
}
}
def
allureVersion
=
"2.15.0"
def
cucumberVersion
=
"6.11.0"
dependencies
{
dependencies
{
//implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
//implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation
'org.springframework.boot:spring-boot-starter-web'
implementation
'org.springframework.boot:spring-boot-starter-web'
...
@@ -61,13 +66,15 @@ dependencies {
...
@@ -61,13 +66,15 @@ dependencies {
testAnnotationProcessor
'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor
'org.projectlombok:lombok:1.18.20'
testImplementation
'org.springframework.boot:spring-boot-starter-test'
testImplementation
'org.springframework.boot:spring-boot-starter-test'
testImplementation
'io.cucumber:cucumber-core:6.10.4'
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-core'
,
version:
cucumberVersion
testImplementation
'io.cucumber:cucumber-java:6.10.4'
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-java'
,
version:
cucumberVersion
testImplementation
'io.cucumber:cucumber-junit:6.10.4'
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-junit'
,
version:
cucumberVersion
testImplementation
'io.cucumber:cucumber-spring:6.10.4'
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-spring'
,
version:
cucumberVersion
//testImplementation 'io.cucumber:cucumber-plugin:6.11.0'
//testImplementation 'io.cucumber:gherkin:21.0.0'
testImplementation
'io.rest-assured:spring-mock-mvc:4.4.0'
testImplementation
'io.rest-assured:spring-mock-mvc:4.4.0'
test
Compile
'io.qameta.allure:allure-cucumber6-jvm:2.14.0'
test
Implementation
group:
'io.qameta.allure'
,
name:
'allure-cucumber6-jvm'
,
version:
allureVersion
compile
files
(
fileTree
(
dir:
"libs"
,
include:
[
'*.jar'
]))
compile
files
(
fileTree
(
dir:
"libs"
,
include:
[
'*.jar'
]))
testCompile
files
(
fileTree
(
dir:
"libs"
,
include:
[
'*.jar'
]))
testCompile
files
(
fileTree
(
dir:
"libs"
,
include:
[
'*.jar'
]))
...
@@ -80,18 +87,20 @@ test {
...
@@ -80,18 +87,20 @@ test {
if
(
testRel
!=
null
&&
!
testRel
.
isEmpty
())
{
if
(
testRel
!=
null
&&
!
testRel
.
isEmpty
())
{
systemProperty
(
"global.test.release"
,
testRel
)
systemProperty
(
"global.test.release"
,
testRel
)
}
}
String
testTarget
=
System
.
properties
.
getProperty
(
"backend"
)
if
(
testTarget
!=
null
&&
!
testTarget
.
isEmpty
())
{
systemProperty
(
"service.backend.host"
,
testTarget
)
}
}
}
allure
{
allure
{
version
=
'2.8.1'
version
=
allureVersion
allureJavaVersion
=
'2.14.0'
//allureJavaVersion = allureVersion
autoconfigure
=
tru
e
autoconfigure
=
fals
e
aspectjweaver
=
true
aspectjweaver
=
true
boolean
clean
=
true
resultsDir
=
file
(
getBuildDir
().
absolutePath
+
'/test-results/allure-results/'
)
resultsDir
=
file
(
getBuildDir
().
absolutePath
+
'/test-results/allure-results/'
)
reportDir
=
file
(
getBuildDir
().
absolutePath
+
'/reports/allure-report/'
)
reportDir
=
file
(
getBuildDir
().
absolutePath
+
'/reports/allure-report/'
)
String
configuration
=
'testCompile'
downloadLink
=
'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/'
+
allureVersion
+
'/allure-commandline-'
+
allureVersion
+
'.zip'
downloadLink
=
'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip'
}
}
sourceSets
{
sourceSets
{
...
...
api/resources/features/apitest/restful/app-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for APP-Service
@app-service
Scenario
:
Verify the exposed APIs work as design for APP-Service
Given
Found OpenAPI definition for app service
Then
Analyze OpenAPI file of app service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/auth-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for AUTH-Service
@auth-service
Scenario
:
Verify the exposed APIs work as design for AUTH-Service
Given
Found OpenAPI definition for auth service
Then
Analyze OpenAPI file of auth service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/chain-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for CHAIN-Service
@chain-service
Scenario
:
Verify the exposed APIs work as design for CHAIN-Service
Given
Found OpenAPI definition for chain service
Then
Analyze OpenAPI file of chain service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/cloud-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for CLOUD-Service
@cloud-service
Scenario
:
Verify the exposed APIs work as design for CLOUD-Service
Given
Found OpenAPI definition for cloud service
Then
Analyze OpenAPI file of cloud service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/commodity-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for COMMODITY-Service
@commodity-service
Scenario
:
Verify the exposed APIs work as design for COMMODITY-Service
Given
Found OpenAPI definition for commodity service
Then
Analyze OpenAPI file of commodity service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/common-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for COMMON-Service
@common-service
Scenario
:
Verify the exposed APIs work as design for COMMON-Service
Given
Found OpenAPI definition for common service
Then
Analyze OpenAPI file of common service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/license-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for LICENSE-Service
@license-service
Scenario
:
Verify the exposed APIs work as design for LICENSE-Service
Given
Found OpenAPI definition for license service
Then
Analyze OpenAPI file of license service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/logger-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for LOGGER-Service
@logger-service
Scenario
:
Verify the exposed APIs work as design for LOGGER-Service
Given
Found OpenAPI definition for logger service
Then
Analyze OpenAPI file of logger service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/monitor-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for MONITOR-Service
@monitor-service
Scenario
:
Verify the exposed APIs work as design for MONITOR-Service
Given
Found OpenAPI definition for monitor service
Then
Analyze OpenAPI file of monitor service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/order-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for ORDER-Service
@order-service
Scenario
:
Verify the exposed APIs work as design for ORDER-Service
Given
Found OpenAPI definition for order service
Then
Analyze OpenAPI file of order service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/pay-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for PAY-Service
@pay-service
Scenario
:
Verify the exposed APIs work as design for PAY-Service
Given
Found OpenAPI definition for pay service
Then
Analyze OpenAPI file of pay service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/user-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for USER-Service
@user-service
Scenario
:
Verify the exposed APIs work as design for USER-Service
Given
Found OpenAPI definition for user service
Then
Analyze OpenAPI file of user service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/apitest/restful/user
_management
/user_register.feature
→
api/resources/features/apitest/restful/user
-service
/user_register.feature
View file @
b61e0c2d
File moved
api/resources/features/apitest/restful/website-service/sanity.feature
0 → 100644
View file @
b61e0c2d
@restfulApi
@sanity
Feature
:
API tests for WEBSITE-Service
@website-service
Scenario
:
Verify the exposed APIs work as design for WEBSITE-Service
Given
Found OpenAPI definition for website service
Then
Analyze OpenAPI file of website service and generate REST-ful requests automatically
\ No newline at end of file
api/resources/features/sanitytest/backend.feature
View file @
b61e0c2d
@restfulApi
@sanity
@restfulApi
Feature
:
API tests for
service of backend
Feature
:
API tests for
ALL Services
@
backend
@
all-service
Scenario
:
Verify the exposed APIs work as design
Scenario
:
Verify the exposed APIs work as design
Given
Found OpenAPI definition for backend service
Given
Found OpenAPI definition for backend service
#When The testing PERSISTENCE data orgUser is ready for backend service
#When The testing PERSISTENCE data orgUser is ready for backend service
...
...
api/resources/testingdata/v2.3.0/openapi/backendOpenAPI.json
0 → 100644
View file @
b61e0c2d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
api/src/main/java/com/fuzamei/autotest/openapi/OpenApiParser.java
View file @
b61e0c2d
...
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
...
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
import
com.fuzamei.autotest.properties.BackendServiceProperties
;
import
com.fuzamei.autotest.properties.BackendServiceProperties
;
import
com.fuzamei.autotest.properties.GlobalProperties
;
import
com.fuzamei.autotest.properties.GlobalProperties
;
import
com.fuzamei.autotest.properties.services.*
;
import
io.restassured.http.ContentType
;
import
io.restassured.http.ContentType
;
import
io.restassured.http.Header
;
import
io.restassured.http.Header
;
import
io.restassured.http.Headers
;
import
io.restassured.http.Headers
;
...
@@ -33,6 +34,45 @@ public class OpenApiParser {
...
@@ -33,6 +34,45 @@ public class OpenApiParser {
BackendServiceProperties
backendServiceProperties
;
BackendServiceProperties
backendServiceProperties
;
@Autowired
@Autowired
AppServiceProperties
appServiceProperties
;
@Autowired
AuthServiceProperties
authServiceProperties
;
@Autowired
ChainServiceProperties
chainServiceProperties
;
@Autowired
CloudServiceProperties
cloudServiceProperties
;
@Autowired
CommodityServiceProperties
commodityServiceProperties
;
@Autowired
CommonServiceProperties
commonServiceProperties
;
@Autowired
LicenseServiceProperties
licenseServiceProperties
;
@Autowired
LoggerServiceProperties
loggerServiceProperties
;
@Autowired
MonitorServiceProperties
monitorServiceProperties
;
@Autowired
OrderServiceProperties
orderServiceProperties
;
@Autowired
PayServiceProperties
payServiceProperties
;
@Autowired
UserServiceProperties
userServiceProperties
;
@Autowired
WebsiteServiceProperties
websiteServiceProperties
;
@Autowired
GlobalProperties
globalProperties
;
GlobalProperties
globalProperties
;
@Resource
@Resource
...
@@ -76,31 +116,19 @@ public class OpenApiParser {
...
@@ -76,31 +116,19 @@ public class OpenApiParser {
}
}
public
void
handleEachHttpMethodInOpenApiFile
(
String
URL
,
Method
httpMethod
,
JsonNode
methodNode
,
JsonNode
definitionNode
,
String
serviceName
)
{
public
void
handleEachHttpMethodInOpenApiFile
(
String
URL
,
Method
httpMethod
,
JsonNode
methodNode
,
JsonNode
definitionNode
,
String
serviceName
)
{
String
path
=
""
;
String
path
=
produceRequestPathForEachService
(
serviceName
,
URL
);
Boolean
h2Enabled
=
false
;
if
(
path
==
null
){
//get whole path
return
;
switch
(
serviceName
.
toLowerCase
()){
}
case
"backend"
:
Boolean
h2Enabled
=
getHttpSchemaForEachService
(
serviceName
);
path
=
backendServiceProperties
.
getHost
()
+
":"
+
backendServiceProperties
.
getPort
()
+
URL
;
//batch replace variables in-path
if
(
backendServiceProperties
.
getHttps
()){
if
(
path
.
contains
(
"chain_type"
)){
path
=
"https://"
+
path
;
path
.
replace
(
"{chain_type}"
,
globalProperties
.
getIntmin
().
toString
());
}
}
else
{
if
(
path
.
matches
(
"\\{.*?\\}"
)){
path
=
"http://"
+
path
;
path
.
replaceAll
(
"\\{.*?\\}"
,
globalProperties
.
getInt32max
().
toString
());
//replaced by 9223372036854775807 ??
}
//batch replace variables in-path
if
(
path
.
contains
(
"chain_type"
)){
path
.
replace
(
"{chain_type}"
,
globalProperties
.
getIntmin
().
toString
());
}
if
(
path
.
matches
(
"\\{.*?\\}"
)){
path
.
replaceAll
(
"\\{.*?\\}"
,
globalProperties
.
getInt32max
().
toString
());
//replaced by 9223372036854775807 ??
}
log
.
info
(
"now we're handling REST request: '{} {}'"
,
httpMethod
.
name
(),
path
);
if
(
backendServiceProperties
.
getHttp2
()){
h2Enabled
=
true
;
}
break
;
}
}
log
.
info
(
"now we're handling REST request: '{} {}'"
,
httpMethod
.
name
(),
path
);
//parse field consumes
//parse field consumes
ContentType
contentType
=
ContentType
.
JSON
;
ContentType
contentType
=
ContentType
.
JSON
;
if
(
methodNode
.
has
(
"consumes"
))
{
if
(
methodNode
.
has
(
"consumes"
))
{
...
@@ -907,4 +935,255 @@ public class OpenApiParser {
...
@@ -907,4 +935,255 @@ public class OpenApiParser {
}
}
}
}
private
String
produceRequestPathForEachService
(
String
serviceName
,
String
URL
)
{
String
path
=
""
;
switch
(
serviceName
.
toLowerCase
())
{
case
"backend"
:
path
=
backendServiceProperties
.
getHost
()
+
":"
+
backendServiceProperties
.
getPort
()
+
URL
;
if
(
backendServiceProperties
.
getHttps
()){
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
case
"app"
:
if
(!
URL
.
toLowerCase
().
contains
(
"app-service"
)){
return
null
;
}
path
=
appServiceProperties
.
getHost
()
+
":"
+
appServiceProperties
.
getPort
()
+
URL
;
if
(
appServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"auth"
:
if
(!
URL
.
toLowerCase
().
contains
(
"auth-service"
))
{
return
null
;
}
path
=
authServiceProperties
.
getHost
()
+
":"
+
authServiceProperties
.
getPort
()
+
URL
;
if
(
authServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"chain"
:
if
(!
URL
.
toLowerCase
().
contains
(
"chain-service"
)){
return
null
;
}
path
=
chainServiceProperties
.
getHost
()
+
":"
+
chainServiceProperties
.
getPort
()
+
URL
;
if
(
chainServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"cloud"
:
if
(!
URL
.
toLowerCase
().
contains
(
"cloud-service"
)){
return
null
;
}
path
=
cloudServiceProperties
.
getHost
()
+
":"
+
cloudServiceProperties
.
getPort
()
+
URL
;
if
(
cloudServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"commodity"
:
if
(!
URL
.
toLowerCase
().
contains
(
"commodity-service"
)){
return
null
;
}
path
=
commodityServiceProperties
.
getHost
()
+
":"
+
commodityServiceProperties
.
getPort
()
+
URL
;
if
(
commodityServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"common"
:
if
(!
URL
.
toLowerCase
().
contains
(
"common-service"
)){
return
null
;
}
path
=
commonServiceProperties
.
getHost
()
+
":"
+
commonServiceProperties
.
getPort
()
+
URL
;
if
(
commonServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"license"
:
if
(!
URL
.
toLowerCase
().
contains
(
"license-service"
)){
return
null
;
}
path
=
licenseServiceProperties
.
getHost
()
+
":"
+
licenseServiceProperties
.
getPort
()
+
URL
;
if
(
licenseServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"logger"
:
if
(!
URL
.
toLowerCase
().
contains
(
"logger-service"
)){
return
null
;
}
path
=
loggerServiceProperties
.
getHost
()
+
":"
+
loggerServiceProperties
.
getPort
()
+
URL
;
if
(
loggerServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"monitor"
:
if
(!
URL
.
toLowerCase
().
contains
(
"monitor-service"
)){
return
null
;
}
path
=
monitorServiceProperties
.
getHost
()
+
":"
+
monitorServiceProperties
.
getPort
()
+
URL
;
if
(
monitorServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"order"
:
if
(!
URL
.
toLowerCase
().
contains
(
"order-service"
)){
return
null
;
}
path
=
orderServiceProperties
.
getHost
()
+
":"
+
orderServiceProperties
.
getPort
()
+
URL
;
if
(
orderServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"pay"
:
if
(!
URL
.
toLowerCase
().
contains
(
"pay-service"
)){
return
null
;
}
path
=
payServiceProperties
.
getHost
()
+
":"
+
payServiceProperties
.
getPort
()
+
URL
;
if
(
payServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"user"
:
if
(!
URL
.
toLowerCase
().
contains
(
"user-service"
)){
return
null
;
}
path
=
userServiceProperties
.
getHost
()
+
":"
+
userServiceProperties
.
getPort
()
+
URL
;
if
(
userServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
case
"website"
:
if
(!
URL
.
toLowerCase
().
contains
(
"website-service"
)){
return
null
;
}
path
=
websiteServiceProperties
.
getHost
()
+
":"
+
websiteServiceProperties
.
getPort
()
+
URL
;
if
(
websiteServiceProperties
.
getHttps
())
{
path
=
"https://"
+
path
;
}
else
{
path
=
"http://"
+
path
;
}
break
;
default
:
break
;
}
return
path
;
}
private
Boolean
getHttpSchemaForEachService
(
String
serviceName
)
{
Boolean
httpSchema
=
false
;
if
(
globalProperties
.
getCombinedDeployment
()
&&
backendServiceProperties
.
getHttp2
()){
httpSchema
=
true
;
}
if
(!
globalProperties
.
getCombinedDeployment
()){
switch
(
serviceName
.
toLowerCase
())
{
case
"app"
:
if
(
appServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"auth"
:
if
(
authServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"chain"
:
if
(
chainServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"cloud"
:
if
(
cloudServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"commodity"
:
if
(
commodityServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"common"
:
if
(
commonServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"license"
:
if
(
licenseServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"logger"
:
if
(
loggerServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"monitor"
:
if
(
monitorServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"order"
:
if
(
orderServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"pay"
:
if
(
payServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"user"
:
if
(
userServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
case
"website"
:
if
(
websiteServiceProperties
.
getHttp2
())
{
httpSchema
=
true
;
}
break
;
}
}
return
httpSchema
;
}
}
}
api/src/main/java/com/fuzamei/autotest/properties/GlobalProperties.java
View file @
b61e0c2d
...
@@ -11,7 +11,7 @@ import java.math.BigDecimal;
...
@@ -11,7 +11,7 @@ import java.math.BigDecimal;
@Component
@Component
@ConfigurationProperties
(
prefix
=
"global.test"
)
@ConfigurationProperties
(
prefix
=
"global.test"
)
@PropertySource
(
value
=
"classpath:application.
properties
"
,
encoding
=
"UTF-8"
)
@PropertySource
(
value
=
"classpath:application.
yml
"
,
encoding
=
"UTF-8"
)
@Setter
@Setter
@Getter
@Getter
...
@@ -35,4 +35,7 @@ public class GlobalProperties {
...
@@ -35,4 +35,7 @@ public class GlobalProperties {
@Value
(
"${server.ssl.enabled}"
)
@Value
(
"${server.ssl.enabled}"
)
private
Boolean
serverSslEnable
;
private
Boolean
serverSslEnable
;
@Value
(
"${service.combinedDeployment}"
)
private
Boolean
combinedDeployment
;
}
}
api/src/main/java/com/fuzamei/autotest/properties/services/AppServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.app"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
AppServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.app.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/AuthServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.auth"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
AuthServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.auth.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/ChainServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.chain"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
ChainServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.chain.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/CloudServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.cloud"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
CloudServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.cloud.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/CommodityServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.commodity"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
CommodityServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.commodity.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/CommonServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.common"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
CommonServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.common.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/LicenseServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.license"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
LicenseServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.license.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/LoggerServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.logger"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
LoggerServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.logger.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/MonitorServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.monitor"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
MonitorServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.monitor.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/OrderServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.order"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
OrderServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.order.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/PayServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.pay"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
PayServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.pay.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/UserServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.user"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
UserServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.user.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/java/com/fuzamei/autotest/properties/services/WebsiteServiceProperties.java
0 → 100644
View file @
b61e0c2d
package
com
.
fuzamei
.
autotest
.
properties
.
services
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.stereotype.Component
;
@Component
@ConfigurationProperties
(
prefix
=
"service.website"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
public
class
WebsiteServiceProperties
{
private
String
host
;
private
String
port
;
private
String
openapifilepath
;
//private String httpschema;
private
Boolean
https
;
@Value
(
"${service.website.http2.enabled}"
)
private
Boolean
http2
;
}
api/src/main/resources/application.yml
View file @
b61e0c2d
...
@@ -8,15 +8,107 @@ grpc:
...
@@ -8,15 +8,107 @@ grpc:
server
:
server
:
port
:
8802
port
:
8802
service
:
service
:
combinedDeployment
:
true
backend
:
backend
:
host
:
172.22.1
7.91
host
:
172.22.1
8.152
port
:
2345
port
:
2345
openapidefinitionpath
:
/
openapidefinitionpath
:
/
https
:
false
https
:
false
http2
:
http2
:
enabled
:
false
enabled
:
false
app
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
auth
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
chain
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
cloud
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
commodity
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
common
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
license
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
logger
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
monitor
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
order
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
pay
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
user
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
website
:
host
:
${service.backend.host}
port
:
${service.backend.port}
openapidefinitionpath
:
/
https
:
${service.backend.https}
http2
:
enabled
:
${service.backend.http2.enabled}
mysql
:
mysql
:
host
:
172.22.18.152
host
:
${service.backend.host}
database
:
baas
database
:
baas
chain33
:
chain33
:
host
:
172.22.19.7
host
:
172.22.19.7
...
@@ -39,3 +131,17 @@ serviceMock:
...
@@ -39,3 +131,17 @@ serviceMock:
responsePath
:
${serviceMock.pathPrefix}/backend.json
responsePath
:
${serviceMock.pathPrefix}/backend.json
chain33
:
chain33
:
responsePath
:
${serviceMock.pathPrefix}/chain33.json
responsePath
:
${serviceMock.pathPrefix}/chain33.json
global
:
test
:
release
:
v2.3.0
intmin
:
0
int32max
:
2147483647
int64max
:
9223372036854775807
dftstring
:
1J7mdg5rbQyUHENYdx39WVWK7fsLpEoXZy1J7mdg5rbQyUHENYdx39WVWK7fsLpE
dftboolean
:
false
dftnumber
:
9999999999.99
dftuserid
:
87654321
dftusername
:
automation
latestchain33version
:
chain33_v1.6.6
datacollectionpath
:
resources/testingdata/
api/src/main/resources/logback-spring.xml
View file @
b61e0c2d
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 日志归档 -->
<!-- 日志归档 -->
<fileNamePattern>
${logging.path}/a
utotest-custom
-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<fileNamePattern>
${logging.path}/a
ll
-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</timeBasedFileNamingAndTriggeringPolicy>
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 每天日志归档路径以及格式 -->
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>
${logging.path}/
autotest-
info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<fileNamePattern>
${logging.path}/info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</timeBasedFileNamingAndTriggeringPolicy>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
</encoder>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logging.path}/
autotest-
warn-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<fileNamePattern>
${logging.path}/warn-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</timeBasedFileNamingAndTriggeringPolicy>
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
</encoder>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
${logging.path}/
web-
error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<fileNamePattern>
${logging.path}/error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</timeBasedFileNamingAndTriggeringPolicy>
...
...
api/src/test/java/com/fuzamei/autotest/steps/openapi/ApiVerification.java
View file @
b61e0c2d
...
@@ -30,30 +30,36 @@ public class ApiVerification {
...
@@ -30,30 +30,36 @@ public class ApiVerification {
@Given
(
"^Found OpenAPI definition for (.*?) service$"
)
@Given
(
"^Found OpenAPI definition for (.*?) service$"
)
public
void
foundOpenApiProfileForTestingVer
(
String
serviceName
)
throws
Throwable
{
public
void
foundOpenApiProfileForTestingVer
(
String
serviceName
)
throws
Throwable
{
String
release
=
globalProperties
.
getRelease
();
String
release
=
globalProperties
.
getRelease
();
switch
(
serviceName
)
{
if
(
globalProperties
.
getCombinedDeployment
())
{
case
"backend"
:
String
openApiFilePath
=
openApiParser
.
getOpenApiFilePathByVersion
(
"backend"
,
release
);
String
openApiFilePath
=
openApiParser
.
getOpenApiFilePathByVersion
(
serviceName
,
release
);
//log.debug("OpenApi definition for {} locates in {}", serviceName, openApiFilePath);
//log.debug("OpenApi definition for {} locates in {}", serviceName, openApiFilePath);
backendServiceProperties
.
setOpenapifilepath
(
openApiFilePath
);
backendServiceProperties
.
setOpenapifilepath
(
openApiFilePath
);
}
break
;
else
{
default
:
switch
(
serviceName
)
{
break
;
default
:
break
;
}
}
}
}
}
@Then
(
"^Analyze OpenAPI file of (.*?) service and generate REST-ful requests automatically$"
)
@Then
(
"^Analyze OpenAPI file of (.*?) service and generate REST-ful requests automatically$"
)
public
void
parseOpenApiAndSendReqToTargetService
(
String
serviceName
)
throws
Throwable
{
public
void
parseOpenApiAndSendReqToTargetService
(
String
serviceName
)
throws
Throwable
{
String
targetServiceApiFilePath
=
""
;
String
targetServiceApiFilePath
=
""
;
switch
(
serviceName
)
{
if
(
globalProperties
.
getCombinedDeployment
())
{
case
"backend"
:
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
if
(
targetServiceApiFilePath
==
null
||
targetServiceApiFilePath
.
isEmpty
())
{
foundOpenApiProfileForTestingVer
(
"backend"
);
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
if
(
targetServiceApiFilePath
==
null
||
targetServiceApiFilePath
.
isEmpty
())
{
}
foundOpenApiProfileForTestingVer
(
"backend"
);
}
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
else
{
};
switch
(
serviceName
)
{
break
;
case
"app"
:
default
:
break
;
break
;
default
:
}
}
}
openApiParser
.
analyzeOpenApiAndGenerateRequests
(
serviceName
,
targetServiceApiFilePath
);
openApiParser
.
analyzeOpenApiAndGenerateRequests
(
serviceName
,
targetServiceApiFilePath
);
}
}
...
...
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