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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
566 additions
and
39 deletions
+566
-39
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
+0
-0
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 {
id
'org.springframework.boot'
version
'2.5.1'
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
id
'java'
id
'io.qameta.allure'
version
'2.8.1'
id
"com.google.protobuf"
version
"0.8.17"
id
'idea'
id
'io.qameta.allure'
version
'2.8.1'
}
group
=
'com.fuzamei'
...
...
@@ -26,6 +26,11 @@ repositories {
jcenter
()
}
def
allureVersion
=
"2.15.0"
def
cucumberVersion
=
"6.11.0"
dependencies
{
//implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation
'org.springframework.boot:spring-boot-starter-web'
...
...
@@ -61,13 +66,15 @@ dependencies {
testAnnotationProcessor
'org.projectlombok:lombok:1.18.20'
testImplementation
'org.springframework.boot:spring-boot-starter-test'
testImplementation
'io.cucumber:cucumber-core:6.10.4'
testImplementation
'io.cucumber:cucumber-java:6.10.4'
testImplementation
'io.cucumber:cucumber-junit:6.10.4'
testImplementation
'io.cucumber:cucumber-spring:6.10.4'
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-core'
,
version:
cucumberVersion
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-java'
,
version:
cucumberVersion
testImplementation
group:
'io.cucumber'
,
name:
'cucumber-junit'
,
version:
cucumberVersion
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'
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'
]))
testCompile
files
(
fileTree
(
dir:
"libs"
,
include:
[
'*.jar'
]))
...
...
@@ -80,18 +87,20 @@ test {
if
(
testRel
!=
null
&&
!
testRel
.
isEmpty
())
{
systemProperty
(
"global.test.release"
,
testRel
)
}
String
testTarget
=
System
.
properties
.
getProperty
(
"backend"
)
if
(
testTarget
!=
null
&&
!
testTarget
.
isEmpty
())
{
systemProperty
(
"service.backend.host"
,
testTarget
)
}
}
allure
{
version
=
'2.8.1'
allureJavaVersion
=
'2.14.0'
autoconfigure
=
tru
e
version
=
allureVersion
//allureJavaVersion = allureVersion
autoconfigure
=
fals
e
aspectjweaver
=
true
boolean
clean
=
true
resultsDir
=
file
(
getBuildDir
().
absolutePath
+
'/test-results/allure-results/'
)
reportDir
=
file
(
getBuildDir
().
absolutePath
+
'/reports/allure-report/'
)
String
configuration
=
'testCompile'
downloadLink
=
'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.1/allure-commandline-2.8.1.zip'
downloadLink
=
'https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/'
+
allureVersion
+
'/allure-commandline-'
+
allureVersion
+
'.zip'
}
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
Feature
:
API tests for
service of backend
@
backend
@restfulApi
Feature
:
API tests for
ALL Services
@
all-service
Scenario
:
Verify the exposed APIs work as design
Given
Found OpenAPI definition 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
This diff is collapsed.
Click to expand it.
api/src/main/java/com/fuzamei/autotest/properties/GlobalProperties.java
View file @
b61e0c2d
...
...
@@ -11,7 +11,7 @@ import java.math.BigDecimal;
@Component
@ConfigurationProperties
(
prefix
=
"global.test"
)
@PropertySource
(
value
=
"classpath:application.
properties
"
,
encoding
=
"UTF-8"
)
@PropertySource
(
value
=
"classpath:application.
yml
"
,
encoding
=
"UTF-8"
)
@Setter
@Getter
...
...
@@ -35,4 +35,7 @@ public class GlobalProperties {
@Value
(
"${server.ssl.enabled}"
)
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:
server
:
port
:
8802
service
:
combinedDeployment
:
true
backend
:
host
:
172.22.1
7.91
host
:
172.22.1
8.152
port
:
2345
openapidefinitionpath
:
/
https
:
false
http2
:
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
:
host
:
172.22.18.152
host
:
${service.backend.host}
database
:
baas
chain33
:
host
:
172.22.19.7
...
...
@@ -39,3 +131,17 @@ serviceMock:
responsePath
:
${serviceMock.pathPrefix}/backend.json
chain33
:
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 @@
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<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"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
...
...
@@ -69,7 +69,7 @@
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<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"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
...
...
@@ -95,7 +95,7 @@
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<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"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
...
...
@@ -121,7 +121,7 @@
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<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"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
...
...
api/src/test/java/com/fuzamei/autotest/steps/openapi/ApiVerification.java
View file @
b61e0c2d
...
...
@@ -30,30 +30,36 @@ public class ApiVerification {
@Given
(
"^Found OpenAPI definition for (.*?) service$"
)
public
void
foundOpenApiProfileForTestingVer
(
String
serviceName
)
throws
Throwable
{
String
release
=
globalProperties
.
getRelease
();
switch
(
serviceName
)
{
case
"backend"
:
String
openApiFilePath
=
openApiParser
.
getOpenApiFilePathByVersion
(
serviceName
,
release
);
//log.debug("OpenApi definition for {} locates in {}", serviceName, openApiFilePath);
backendServiceProperties
.
setOpenapifilepath
(
openApiFilePath
);
break
;
default
:
break
;
if
(
globalProperties
.
getCombinedDeployment
())
{
String
openApiFilePath
=
openApiParser
.
getOpenApiFilePathByVersion
(
"backend"
,
release
);
//log.debug("OpenApi definition for {} locates in {}", serviceName, openApiFilePath);
backendServiceProperties
.
setOpenapifilepath
(
openApiFilePath
);
}
else
{
switch
(
serviceName
)
{
default
:
break
;
}
}
}
@Then
(
"^Analyze OpenAPI file of (.*?) service and generate REST-ful requests automatically$"
)
public
void
parseOpenApiAndSendReqToTargetService
(
String
serviceName
)
throws
Throwable
{
String
targetServiceApiFilePath
=
""
;
switch
(
serviceName
)
{
case
"backend"
:
if
(
globalProperties
.
getCombinedDeployment
())
{
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
if
(
targetServiceApiFilePath
==
null
||
targetServiceApiFilePath
.
isEmpty
())
{
foundOpenApiProfileForTestingVer
(
"backend"
);
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
if
(
targetServiceApiFilePath
==
null
||
targetServiceApiFilePath
.
isEmpty
())
{
foundOpenApiProfileForTestingVer
(
"backend"
);
targetServiceApiFilePath
=
backendServiceProperties
.
getOpenapifilepath
();
};
break
;
default
:
break
;
}
}
else
{
switch
(
serviceName
)
{
case
"app"
:
break
;
default
:
}
}
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