-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build #2548
Fix build #2548
Changes from all commits
72c8b9f
4939d93
ff0fe85
cba321b
a579c52
8b95b9b
31c9ec1
70bf344
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import io.micronaut.http.client.annotation.Client | |
import io.micronaut.runtime.server.EmbeddedServer | ||
import io.micronaut.test.extensions.spock.annotation.MicronautTest | ||
import jakarta.inject.Inject | ||
import spock.lang.Ignore | ||
import spock.lang.Specification | ||
|
||
@MicronautTest | ||
|
@@ -18,19 +19,42 @@ class OpenAPISpec extends Specification { | |
@Inject | ||
HttpClient client | ||
|
||
void "test swagger-ui"() { | ||
@Ignore | ||
void "test swagger-ui links"() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @altro3 has the html output changed for swagger-ui and rapid? These tests which verified the links fail now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, links were changed. Chanes here: micronaut-projects/micronaut-openapi#1626 Currently, links to scripts are not explicitly specified, and scripts are loaded dynamically. The code in the test must be changed |
||
when: | ||
def response = client.toBlocking().retrieve("/swagger-ui/index.html", String) | ||
|
||
String response = client.toBlocking().retrieve("/swagger-ui/index.html", String) | ||
List<String> matches = (response =~ /(?:src|href)=['"]([^'"]+)['"]/).collect { it[1] as String } | ||
String yml = (response =~ /['"]([^'"]+\.yml)['"]/)[0][1] | ||
|
||
then: | ||
matches.size() | ||
|
||
and: | ||
matches.each { | ||
assert client.toBlocking().exchange(it).status() == HttpStatus.OK | ||
} | ||
} | ||
|
||
void "test swagger-ui"() { | ||
when: | ||
String response = client.toBlocking().retrieve("/swagger-ui/index.html", String) | ||
String yml = (response =~ /['"]([^'"]+\.yml)['"]/)[0][1] | ||
|
||
then: | ||
yml | ||
|
||
and: | ||
server.getURI().resolve(yml).toURL().text.contains("title: Micronaut Launch") | ||
} | ||
|
||
@Ignore | ||
void "test rapidoc links"() { | ||
when: | ||
String response = client.toBlocking().retrieve("/rapidoc/index.html", String) | ||
|
||
List<String> matches = (response =~ /(?:src|href)=['"]([^'"]+)['"]/).collect { it[1] as String } | ||
|
||
then: | ||
matches.size() | ||
|
||
and: | ||
matches.each { | ||
|
@@ -40,21 +64,14 @@ class OpenAPISpec extends Specification { | |
|
||
void "test rapidoc"() { | ||
when: | ||
def response = client.toBlocking().retrieve("/rapidoc/index.html", String) | ||
String response = client.toBlocking().retrieve("/rapidoc/index.html", String) | ||
|
||
List<String> matches = (response =~ /(?:src|href)=['"]([^'"]+)['"]/).collect { it[1] as String } | ||
String yml = (response =~ /['"]([^'"]+\.yml)['"]/)[0][1] | ||
|
||
then: | ||
matches.size() | ||
yml | ||
|
||
and: | ||
server.getURI().resolve(yml).toURL().text.contains("title: Micronaut Launch") | ||
|
||
and: | ||
matches.each { | ||
assert client.toBlocking().exchange(it).status() == HttpStatus.OK | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yawkat @dstepanov have we changed how
Publisher<String>
is managed? I had to change this. The previous code was timing out in the test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be micronaut-projects/micronaut-core#11107