make sure the webapp and openapi documentation are always up to date by preventing caching

This commit is contained in:
Athou
2024-08-26 00:17:42 +02:00
parent 764c1a6430
commit 63c7679067
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package com.commafeed.integration;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
@QuarkusTest
class StaticFilesIT {
@ParameterizedTest
@ValueSource(strings = { "/", "/openapi.json", "/openapi.yaml" })
void servedWithoutCache(String path) {
RestAssured.given().when().get(path).then().statusCode(200).header("Cache-Control", "no-cache, no-store, must-revalidate");
}
@ParameterizedTest
@ValueSource(strings = { "/favicon.ico" })
void servedWithCache(String path) {
RestAssured.given().when().get(path).then().statusCode(200).header("Cache-Control", "public, immutable, max-age=86400");
}
}