-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #41294 from gsmet/3.11.3-backports-2
[3.11] 3.11.3 backports 2
- Loading branch information
Showing
14 changed files
with
498 additions
and
13 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
63 changes: 63 additions & 0 deletions
63
...st/java/io/quarkus/resteasy/reactive/server/test/preconditions/DatePreconditionTests.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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package io.quarkus.resteasy.reactive.server.test.preconditions; | ||
|
||
import static io.restassured.RestAssured.get; | ||
|
||
import java.time.Instant; | ||
import java.util.Date; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.Request; | ||
import jakarta.ws.rs.core.Response; | ||
import jakarta.ws.rs.core.Response.ResponseBuilder; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class DatePreconditionTests { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(Resource.class)); | ||
|
||
// Make sure we test a subtype of Date, since that is what Hibernate ORM gives us most of the time (hah) | ||
// Also make sure we have non-zero milliseconds, since that will be the case for most date values representing | ||
// "now", and we want to make sure pre-conditions work (second-resolution) | ||
static final Date date = new Date(Date.from(Instant.parse("2007-12-03T10:15:30.24Z")).getTime()) { | ||
}; | ||
|
||
public static class Something { | ||
} | ||
|
||
@Test | ||
public void test() { | ||
get("/preconditions") | ||
.then() | ||
.statusCode(200) | ||
.header("Last-Modified", "Mon, 03 Dec 2007 10:15:30 GMT") | ||
.body(Matchers.equalTo("foo")); | ||
RestAssured | ||
.with() | ||
.header("If-Modified-Since", "Mon, 03 Dec 2007 10:15:30 GMT") | ||
.get("/preconditions") | ||
.then() | ||
.statusCode(304); | ||
} | ||
|
||
@Path("/preconditions") | ||
public static class Resource { | ||
@GET | ||
public Response get(Request request) { | ||
ResponseBuilder resp = request.evaluatePreconditions(date); | ||
if (resp != null) { | ||
return resp.build(); | ||
} | ||
return Response.ok("foo").lastModified(date).build(); | ||
} | ||
} | ||
} |
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
288 changes: 288 additions & 0 deletions
288
...ts/quarkus/project/quarkus/base/src/main/resources/META-INF/resources/index.tpl.qute.html
Large diffs are not rendered by default.
Oops, something went wrong.
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
23 changes: 23 additions & 0 deletions
23
...src/test/java/io/quarkus/devtools/codestarts/core/reader/QuteCodestartFileReaderTest.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.quarkus.devtools.codestarts.core.reader; | ||
|
||
import static io.quarkus.devtools.codestarts.core.reader.QuteCodestartFileReader.*; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class QuteCodestartFileReaderTest { | ||
|
||
@Test | ||
void testCompareVersion() { | ||
assertThat(compareVersionTo("3.12.0.Final", "1.0")).isGreaterThan(0); | ||
assertThat(compareVersionTo("3.12.0.Final", "3.12")).isEqualTo(0); | ||
assertThat(compareVersionTo("3.13.0", "3.12")).isGreaterThan(0); | ||
assertThat(compareVersionTo("3.2.1", "3.12")).isLessThan(0); | ||
assertThat(compareVersionTo("999-SNAPSHOT", "3.12")).isGreaterThan(0); | ||
assertThat(compareVersionTo("1.0.0.Final-redhat-00001", "1.0")).isGreaterThan(0); | ||
assertThat(compareVersionTo("1.0.1.Final-redhat-00001", "1.0")).isGreaterThan(0); | ||
assertThatThrownBy(() -> compareVersionTo("999-SNAP", "1.0.1.Final-redhat-00001")) | ||
.isInstanceOf(IllegalArgumentException.class); | ||
} | ||
} |
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