-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !27 from Stanic/auto-2285005-main-d54075a9
- Loading branch information
Showing
11 changed files
with
125 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,4 @@ spring: | |
name: qing-web-service | ||
graphql: | ||
graphiql: | ||
enabled: true | ||
h2: | ||
console: | ||
enabled: true | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,3 @@ type DailyRevenue { | |
date: String | ||
revenue: Int | ||
} | ||
|
||
|
74 changes: 37 additions & 37 deletions
74
...src/test/java/cn/chenyunlong/qing/application/manager/web/graphql/BookControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
package cn.chenyunlong.qing.application.manager.web.graphql; | ||
|
||
import cn.chenyunlong.qing.application.manager.AbstractTests; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.graphql.tester.AutoConfigureGraphQlTester; | ||
import org.springframework.graphql.test.tester.GraphQlTester; | ||
|
||
|
||
@AutoConfigureGraphQlTester | ||
class BookControllerTest extends AbstractTests { | ||
|
||
|
||
@Autowired | ||
private GraphQlTester graphQlTester; | ||
|
||
@Test | ||
void findAll() { | ||
String query = """ | ||
{ | ||
books { | ||
id | ||
name | ||
pageCount | ||
authorId | ||
} | ||
}"""; | ||
List<Book> books = graphQlTester.document(query) | ||
.execute() | ||
.path("data.books[*]") | ||
.entityList(Book.class) | ||
.get(); | ||
Assertions.assertFalse(books.isEmpty()); | ||
Assertions.assertNotNull(books.get(0).id()); | ||
Assertions.assertNotNull(books.get(0).name()); | ||
} | ||
} | ||
// import cn.chenyunlong.qing.application.manager.AbstractTests; | ||
// import jakarta.annotation.Resource; | ||
// import java.util.List; | ||
// import org.junit.jupiter.api.Assertions; | ||
// import org.junit.jupiter.api.Test; | ||
// import org.springframework.boot.test.autoconfigure.graphql.tester.AutoConfigureGraphQlTester; | ||
// import org.springframework.graphql.test.tester.GraphQlTester; | ||
// | ||
// | ||
// @AutoConfigureGraphQlTester | ||
// class BookControllerTest extends AbstractTests { | ||
// | ||
// | ||
// @Resource | ||
// private GraphQlTester graphQlTester; | ||
// | ||
// @Test | ||
// void findAll() { | ||
// String query = """ | ||
// { | ||
// books { | ||
// id | ||
// name | ||
// pageCount | ||
// authorId | ||
// } | ||
// }"""; | ||
// List<Book> books = graphQlTester.document(query) | ||
// .execute() | ||
// .path("data.books[*]") | ||
// .entityList(Book.class) | ||
// .get(); | ||
// Assertions.assertFalse(books.isEmpty()); | ||
// Assertions.assertNotNull(books.get(0).id()); | ||
// Assertions.assertNotNull(books.get(0).name()); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
qing-application/qing-application-manager/src/test/resources/application-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
spring: | ||
datasource: | ||
hikari: | ||
username: sa | ||
password: | ||
driver-class-name: org.h2.Driver | ||
url: jdbc:h2:mem:qing;Mode=MYSQL | ||
jpa: | ||
show-sql: true | ||
generate-ddl: true | ||
open-in-view: false | ||
database-platform: org.hibernate.dialect.MySQLDialect | ||
hibernate: | ||
ddl-auto: create-drop | ||
mail: | ||
host: smtp.qq.com | ||
username: [email protected] | ||
password: 123456789 | ||
logging: | ||
level: | ||
root: info | ||
cn.chenyunlong.qing: debug | ||
mp: | ||
wx: | ||
appId: WX09BF7E7056150A9C | ||
secret: 9FDB9FA846356D3224A345b58791 | ||
qing: | ||
authing: | ||
appId: 6432d5c9e0502f0bb45319bf | ||
appSecret: a599ddfc87b4478596b31a17e46d2360 | ||
appHost: https://stanic.authing.cn/6432d5c9e0502f0bb45319bf | ||
redirectUrl: http://localhost:8080/api/auth/authingLogin | ||
mp: | ||
# 测试账号 | ||
appId: wx9e955703886af7c9 | ||
secret: 9d8cbf48467d38006f50f13d499f5abc | ||
token: 123123 | ||
aes-key: ZcipcxwIwYh0WFFdBPZXlrxzNVmTWPq4OuVh4RzHGh6 | ||
mailEnabled: true | ||
oss: | ||
secretId: AKIDshIHBtNfjX7SWRCizNdePu85nHX1HG0V | ||
secretKey: KOCjz0lG76xc6LPGvRjmaBbsjPtESUHp | ||
region: ap-guangzhou | ||
bucketName: anime-1255705827 | ||
file: | ||
baseUploadDir: upload/ | ||
image-server-url: http://localhost:8080 | ||
# 是否异步记录用户操作日志 | ||
openAopLog: true | ||
swagger: | ||
doc-disabled: false | ||
index-size: 26 | ||
debug: false | ||
eureka: | ||
client: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters