Skip to content
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

Migrate Bitnami images to the official ones #277

Merged
merged 5 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MongoTestResource implements QuarkusTestResourceLifecycleManager {

@Override
public Map<String, String> start() {
resource = new GenericContainer<>("quay.io/bitnami/mongodb:4.0.23");
resource = new GenericContainer<>("docker.io/mongo:4.0.23");
resource.waitingFor(new LogMessageWaitStrategy().withRegEx("(?i).*waiting for connections.*"));
resource.addExposedPort(PORT);
resource.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ io.quarkus.qe.ping.clients.TokenPropagationPongClient/mp-rest/url=http://localho

#OpenAPI
quarkus.smallrye-openapi.store-schema-directory=target/generated/jax-rs/
quarkus.smallrye-openapi.info-title=Custom API Title
quarkus.smallrye-openapi.info-version=1.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class OpenApiTest {
private static final Path JSON_FILE_NAME_FULL_PATH = Paths.get(directory + JSON_FILE_NAME);

private static final String EXPECTED_TAGS = "[{\"name\":\"Ping\",\"description\":\"Ping API\"},{\"name\":\"Pong\",\"description\":\"Pong API\"}]";
private static final String EXPECTED_INFO = "{\"title\":\"Generated API\",\"version\":\"1.0\"}";
private static final String EXPECTED_INFO = "{\"title\":\"Custom API Title\",\"version\":\"1.0.1\"}";

// QUARKUS-716
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,5 @@

@NativeImageTest
public class OpenApiTestIT extends OpenApiTest {
// quarkus-maven-plugin:build adjusts OpenAPI info
// see https://github.com/quarkusio/quarkus/pull/19148/commits/8fe04d7a06aa976e0b85d72864578f3ab834a27a
// surefire is executed before quarkus-maven-plugin:build and thus the message there is the generic one
private static final String QUARKUS_ADJUSTED_INFO = "{\"title\":\"013-quarkus-oidc-restclient API\",\"version\":\"1.0.0-SNAPSHOT\"}";

@Override
String getExpectedInfo() {
return QUARKUS_ADJUSTED_INFO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MySqlDatabaseTestResource implements QuarkusTestResourceLifecycleMa
@Override
public Map<String, String> start() {
container = new MySQLContainer<>(
DockerImageName.parse("quay.io/bitnami/mysql:5.7.32").asCompatibleSubstituteFor(MYSQL));
DockerImageName.parse("docker.io/mysql:5.7").asCompatibleSubstituteFor(MYSQL));
container.withUrlParam("currentSchema", DEFAULT_SCHEMA);
container.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ConsulContainer extends GenericContainer<ConsulContainer> {
private static final int PORT = 8500;

public ConsulContainer() {
super("quay.io/bitnami/consul:1.9.3");
super("docker.io/consul:1.9.3");
waitingFor(new LogMessageWaitStrategy().withRegEx(".*Synced node info.*\\s"));
withStartupTimeout(Duration.ofMillis(60000));
addFixedExposedPort(PORT, PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class RedisResource implements QuarkusTestResourceLifecycleManager {
@Override
public Map<String, String> start() {

redisContainer = new GenericContainer(DockerImageName.parse("quay.io/bitnami/redis:6.0"))
redisContainer = new GenericContainer(DockerImageName.parse("docker.io/redis:6.0"))
.withEnv("ALLOW_EMPTY_PASSWORD", "yes").withExposedPorts(6379);
redisContainer.start();

Expand Down
4 changes: 4 additions & 0 deletions 303-quarkus-vertx-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
<artifactId>smallrye-mutiny-vertx-web-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
</dependencies>
<profiles>
<!-- Skipped on Windows as does not support Linux Containers / Testcontainers -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public class MysqlResource implements QuarkusTestResourceLifecycleManager {

@Override
public Map<String, String> start() {
mysqlContainer = new GenericContainer<>(DockerImageName.parse("quay.io/bitnami/mysql:8.0"))
mysqlContainer = new GenericContainer<>(DockerImageName.parse("docker.io/mysql:8.0"))
.withEnv("MYSQL_ROOT_PASSWORD", "test")
.withEnv("MYSQL_USER", "test")
.withEnv("MYSQL_PASSWORD", "test")
.withEnv("MYSQL_DATABASE", "amadeus")
.withExposedPorts(3306);

mysqlContainer.waitingFor(new HostPortWaitStrategy()).waitingFor(
Wait.forLogMessage(".*ready for connections.*", 1)).start();
Wait.forLogMessage(".*ready for connections.*port: 33060.*", 1)).start();

Map<String, String> config = new HashMap<>();
config.put("quarkus.datasource.mysql.jdbc.url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class PostgresqlResource implements QuarkusTestResourceLifecycleManager {

@Override
public Map<String, String> start() {
postgresContainer = new GenericContainer<>(DockerImageName.parse("quay.io/bitnami/postgresql:13.4.0"))
postgresContainer = new GenericContainer<>(DockerImageName.parse("docker.io/postgres:13.6"))
.withEnv("POSTGRES_USER", "test")
.withEnv("POSTGRES_PASSWORD", "test")
.withEnv("POSTGRES_DB", "amadeus")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
POSTGRES_DB: amadeus

mysql:
image: quay.io/bitnami/mysql:5.7.32
image: docker.io/mysql:5.7.32
hostname: mysql
container_name: mysql
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.qe.validation;

import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetails;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetail;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorField;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorStatus;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorTitle;
Expand Down Expand Up @@ -30,7 +30,7 @@ public void shouldGetValidationErrorWhenRequestFirstCodeIsWrong() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestBody.param.firstCode", "First code must have 3 characters");
}
Expand All @@ -49,7 +49,7 @@ public void shouldGetValidationErrorsWhenFirstAndSecondCodesAreWrong() {
.statusCode(HttpStatus.SC_BAD_REQUEST)
.extract().as(ValidationErrorResponse.class);
assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestBody.param.firstCode", "First code must have 3 characters");
assertValidationErrorField(response, "validateRequestBody.param.secondCode", "Second second must match pattern");
Expand All @@ -71,7 +71,7 @@ public void shouldGetValidationErrorWhenSingleParamIsLowercase() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestBody.param.custom", "Value must be uppercase");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.qe.validation;

import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetails;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetail;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorField;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorStatus;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorTitle;
Expand All @@ -25,7 +25,7 @@ public void shouldGetValidationErrorWhenSingleParamIsWrong() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestSingleParam.param", "Param must have 3 characters");
}
Expand All @@ -46,7 +46,7 @@ public void shouldGetValidationErrorsWhenAllParamsAreWrong() {
.statusCode(HttpStatus.SC_BAD_REQUEST)
.extract().as(ValidationErrorResponse.class);
assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestMultipleParam.firstParam", "First param must have 3 characters");
assertValidationErrorField(response, "validateRequestMultipleParam.secondParam", "Second param must match pattern");
Expand All @@ -70,7 +70,7 @@ public void shouldGetValidationErrorWhenSingleParamIsLowercase() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_BAD_REQUEST);
assertValidationErrorField(response, "validateRequestSingleParamUsingCustomValidation.param",
"Value must be uppercase");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.quarkus.qe.validation;

import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetails;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorDetail;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorField;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorStatus;
import static io.quarkus.qe.validation.utils.ValidationAssertions.assertValidationErrorTitle;
Expand Down Expand Up @@ -34,7 +34,7 @@ public void shouldGetValidationErrorWhenUniResponseIdIsWrong() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_INTERNAL_SERVER_ERROR);
assertValidationErrorField(response, "id", "id can't be null");
}
Expand All @@ -50,7 +50,7 @@ public void shouldGetValidationErrorWhenUniResponseStringIsWrong() {
.extract().as(ValidationErrorResponse.class);

assertValidationErrorTitle(response);
assertValidationErrorDetails(response);
assertValidationErrorDetail(response);
assertValidationErrorStatus(response, HttpStatus.SC_INTERNAL_SERVER_ERROR);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static final void assertValidationErrorTitle(ValidationErrorResponse resp
assertEquals("Constraint Violation", response.getTitle());
}

public static final void assertValidationErrorDetails(ValidationErrorResponse response) {
assertEquals("validation constraint violations", response.getDetails());
public static final void assertValidationErrorDetail(ValidationErrorResponse response) {
assertEquals("validation constraint violations", response.getDetail());
}

public static final void assertValidationErrorStatus(ValidationErrorResponse response, int expected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class ValidationErrorResponse {
private String title;
private String details;
private String detail;
private int status;
private ValidationError[] violations;

Expand All @@ -14,12 +14,12 @@ public void setTitle(String title) {
this.title = title;
}

public String getDetails() {
return details;
public String getDetail() {
return detail;
}

public void setDetails(String details) {
this.details = details;
public void setDetail(String detail) {
this.detail = detail;
}

public int getStatus() {
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<module>300-quarkus-vertx-webClient</module>
<module>301-quarkus-vertx-kafka</module>
<module>302-quarkus-vertx-jwt</module>
<!-- TODO: https://github.com/quarkusio/quarkus/issues/21516 -->
<!--<module>303-quarkus-vertx-sql</module>
<module>304-quarkus-vertx-routes</module> -->
<module>303-quarkus-vertx-sql</module>
<module>304-quarkus-vertx-routes</module>
<module>601-spring-data-primitive-types</module>
<module>602-spring-data-rest</module>
<module>603-spring-web-smallrye-openapi</module>
Expand Down