Skip to content
Snippets Groups Projects
Commit 9d409c39 authored by Zachary Sabourin's avatar Zachary Sabourin
Browse files

Merge branch 'zacharysabourin/main/15' into 'main'

feat: Standardize configs

See merge request !26
parents 9b8f9345 9fbd425b
No related branches found
No related tags found
1 merge request!26feat: Standardize configs
Pipeline #30547 passed
......@@ -5,7 +5,7 @@
<artifactId>eclipsefdn-downloads-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<eclipse-api-version>0.7.6</eclipse-api-version>
<eclipse-api-version>0.7.7</eclipse-api-version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.target>11</maven.compiler.target>
......
0quarkus.log.level=INFO
## Quarkus configs
quarkus.log.level=INFO
quarkus.http.port=8090
quarkus.http.root-path=/download
quarkus.http.cors=true
quarkus.http.enable-compression=true
quarkus.http.non-application-root-path=non-application
security.csrf.enabled=true
security.csrf.distributed-mode.default-provider=false
## Security configs
eclipse.security.csrf.enabled=true
eclipse.security.csrf.distributed-mode.is-default-provider=false
eclipse.security.csrf.distributed-mode.enabled=false
quarkus.oidc.enabled = false
security.csrf.enabled.distributed-mode=false
quarkus.oidc.enabled=false
## DATASOURCE CONFIG
eclipse.db.default.limit=10
eclipse.db.default.limit.max=100
eclipse.persistence.pagination-limit=10
eclipse.persistence.pagination-limit.max=100
quarkus.datasource.db-kind=mariadb
quarkus.datasource.jdbc.min-size = 5
quarkus.datasource.jdbc.max-size = 15
quarkus.oidc.enabled=false
## RestClient configs
drupal/mp-rest/url=https://eclipse.org
drupal/mp-rest/followRedirects=true
# Tells Quarkus which objects are associated with what databases (used to generate entity tables internally)
## Tells Quarkus which objects are associated with what databases (used to generate entity tables internally)
quarkus.hibernate-orm.packages=org.eclipsefoundation.downloads.dto,org.eclipsefoundation.persistence.dto
quarkus.hibernate-orm.datasource=<default>
quarkus.hibernate-orm.physical-naming-strategy=org.eclipsefoundation.downloads.config.DefaultPhysicalNamingStrategy
\ No newline at end of file
......@@ -21,7 +21,6 @@ import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
@TestInstance(Lifecycle.PER_CLASS)
@QuarkusTest
......@@ -34,8 +33,7 @@ class DownloadsResourceTest {
public static final String LEGACY_RELEASE_URL = DOWNLOADS_BASE_URL + "/release/{releaseType}";
public static final String LEGACY_RELEASE_NAME_URL = LEGACY_RELEASE_URL + "?release_name={param}";
public static final String LEGACY_RELEASE_VERSION_URL = LEGACY_RELEASE_URL + "?release_version={param}";
public static final String LEGACY_RELEASE_NAME_VERSION_URL = LEGACY_RELEASE_URL
+ "?release_name={param1}&release_version={param2}";
public static final String LEGACY_RELEASE_NAME_VERSION_URL = LEGACY_RELEASE_URL + "?release_name={param1}&release_version={param2}";
public static final String RELEASES_URL = RELEASE_BASE_URL + "/{releaseType}/{releaseName}";
public static final String RELEASE_VERSION_URL = RELEASES_URL + "/{releaseVersion}";
......@@ -43,84 +41,69 @@ class DownloadsResourceTest {
/*
* FILE BY ID
*/
public static final EndpointTestCase FILE_BY_ID_SUCCESS = TestCaseHelper.buildSuccessCase(FILE_BY_ID_URL,
new String[] { "1" }, SchemaNamespaceHelper.FILE_SCHEMA_PATH);
public static final EndpointTestCase FILE_BY_ID_SUCCESS = TestCaseHelper
.buildSuccessCase(FILE_BY_ID_URL, new String[] { "1" }, SchemaNamespaceHelper.FILE_SCHEMA_PATH);
public static final EndpointTestCase FILE_BY_ID_NOT_FOUND = TestCaseHelper.buildNotFoundCase(FILE_BY_ID_URL,
new String[] { "99999" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase FILE_BY_ID_INVALID_FORMAT = TestCaseHelper
.buildInvalidFormatCase(FILE_BY_ID_URL, new String[] { "1" }, ContentType.TEXT);
public static final EndpointTestCase FILE_BY_ID_NOT_FOUND = TestCaseHelper
.buildNotFoundCase(FILE_BY_ID_URL, new String[] { "99999" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
/*
* LEGACY RELEASE
*/
public static final EndpointTestCase LEGACY_RELEASE_SUCCESS_NAME = TestCaseHelper.buildSuccessCase(
LEGACY_RELEASE_NAME_URL, new String[] { "epp", "2021-12" },
SchemaNamespaceHelper.RELEASES_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_SUCCESS_NAME_VERSION = TestCaseHelper.buildSuccessCase(
LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "epp", "2021-12", "r" },
SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_SUCCESS_NAME = TestCaseHelper
.buildSuccessCase(LEGACY_RELEASE_NAME_URL, new String[] { "epp", "2021-12" }, SchemaNamespaceHelper.RELEASES_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_INVALID_TYPE = TestCaseHelper.buildBadRequestCase(
LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "new", "2021-12", "r" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_SUCCESS_NAME_VERSION = TestCaseHelper
.buildSuccessCase(LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "epp", "2021-12", "r" },
SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NO_NAME = TestCaseHelper.buildSuccessCase(
LEGACY_RELEASE_URL, new String[] { "eclipse_packages" }, SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_INVALID_TYPE = TestCaseHelper
.buildBadRequestCase(LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "new", "2021-12", "r" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NO_NAME_VERSION = TestCaseHelper.buildBadRequestCase(
LEGACY_RELEASE_VERSION_URL, new String[] { "eclipse_packages", "r" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NO_NAME = TestCaseHelper
.buildSuccessCase(LEGACY_RELEASE_URL, new String[] { "eclipse_packages" }, SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NAME_NOT_FOUND = TestCaseHelper.buildNotFoundCase(
LEGACY_RELEASE_NAME_URL, new String[] { "eclipse_packages", "nitro" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NO_NAME_VERSION = TestCaseHelper
.buildBadRequestCase(LEGACY_RELEASE_VERSION_URL, new String[] { "eclipse_packages", "r" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_VERSION_NOT_FOUND = TestCaseHelper.buildNotFoundCase(
LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "eclipse_packages", "epp", "nitro" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_NAME_NOT_FOUND = TestCaseHelper
.buildNotFoundCase(LEGACY_RELEASE_NAME_URL, new String[] { "eclipse_packages", "nitro" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase LEGACY_RELEASE_INVALID_FORMAT = TestCaseHelper
.buildInvalidFormatCase(LEGACY_RELEASE_NAME_URL, new String[] { "epp", "2021-12" },
ContentType.TEXT);
public static final EndpointTestCase LEGACY_RELEASE_VERSION_NOT_FOUND = TestCaseHelper
.buildNotFoundCase(LEGACY_RELEASE_NAME_VERSION_URL, new String[] { "eclipse_packages", "epp", "nitro" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
/*
* GET RELEASES
*/
public static final EndpointTestCase GET_RELEASES_SUCCESS = TestCaseHelper.buildSuccessCase(RELEASES_URL,
new String[] { "epp", "2021-06" }, SchemaNamespaceHelper.RELEASES_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASES_SUCCESS = TestCaseHelper
.buildSuccessCase(RELEASES_URL, new String[] { "epp", "2021-06" }, SchemaNamespaceHelper.RELEASES_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASES_NOT_FOUND = TestCaseHelper.buildNotFoundCase(RELEASES_URL,
new String[] { "epp", "nitro" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASES_NOT_FOUND = TestCaseHelper
.buildNotFoundCase(RELEASES_URL, new String[] { "epp", "nitro" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASES_INVALID_TYPE = TestCaseHelper.buildBadRequestCase(
RELEASES_URL, new String[] { "new", "2021-06" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASES_INVALID_FORMAT = TestCaseHelper
.buildInvalidFormatCase(RELEASES_URL, new String[] { "epp", "2021-06" }, ContentType.TEXT);
public static final EndpointTestCase GET_RELEASES_INVALID_TYPE = TestCaseHelper
.buildBadRequestCase(RELEASES_URL, new String[] { "new", "2021-06" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
/*
* GET RELEASE VERSION
*/
public static final EndpointTestCase GET_RELEASE_VERSION_SUCCESS = TestCaseHelper.buildSuccessCase(
RELEASE_VERSION_URL, new String[] { "eclipse_packages", "2021-06", "r" },
SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_NOT_FOUND_NAME = TestCaseHelper.buildNotFoundCase(
RELEASE_VERSION_URL, new String[] { "eclipse_packages", "nitro", "m1" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_SUCCESS = TestCaseHelper
.buildSuccessCase(RELEASE_VERSION_URL, new String[] { "eclipse_packages", "2021-06", "r" },
SchemaNamespaceHelper.RELEASE_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_NOT_FOUND_VERSION = TestCaseHelper.buildNotFoundCase(
RELEASE_VERSION_URL, new String[] { "epp", "2020-03", "version1" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_NOT_FOUND_NAME = TestCaseHelper
.buildNotFoundCase(RELEASE_VERSION_URL, new String[] { "eclipse_packages", "nitro", "m1" },
SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_INVALID_TYPE = TestCaseHelper.buildBadRequestCase(
RELEASE_VERSION_URL, new String[] { "new", "2021-06", "r" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_NOT_FOUND_VERSION = TestCaseHelper
.buildNotFoundCase(RELEASE_VERSION_URL, new String[] { "epp", "2020-03", "version1" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
public static final EndpointTestCase GET_RELEASE_VERSION_INVALID_FORMAT = TestCaseHelper
.buildInvalidFormatCase(RELEASE_VERSION_URL, new String[] { "epp", "2021-06", "m1" }, ContentType.TEXT);
public static final EndpointTestCase GET_RELEASE_VERSION_INVALID_TYPE = TestCaseHelper
.buildBadRequestCase(RELEASE_VERSION_URL, new String[] { "new", "2021-06", "r" }, SchemaNamespaceHelper.ERROR_SCHEMA_PATH);
/*
* FILE BY ID
......@@ -150,11 +133,6 @@ class DownloadsResourceTest {
RestAssuredTemplates.testGet_validateSchema(FILE_BY_ID_NOT_FOUND);
}
@Test
void getFileByID_failure_invalidRequestFormat() {
RestAssuredTemplates.testGet(FILE_BY_ID_INVALID_FORMAT);
}
/*
* LEGACY RELEASE
*/
......@@ -212,11 +190,6 @@ class DownloadsResourceTest {
RestAssuredTemplates.testGet_validateSchema(LEGACY_RELEASE_VERSION_NOT_FOUND);
}
@Test
void getReleaseLegacy_failure_invalidRequestFormat() {
RestAssuredTemplates.testGet(LEGACY_RELEASE_INVALID_FORMAT);
}
/*
* GET RELEASE
*/
......@@ -255,11 +228,6 @@ class DownloadsResourceTest {
RestAssuredTemplates.testGet_validateSchema(GET_RELEASES_INVALID_TYPE);
}
@Test
void getRelease_failure_invalidRequestFormat() {
RestAssuredTemplates.testGet(GET_RELEASES_INVALID_FORMAT);
}
/*
* GET RELEASE VERSION
*/
......@@ -307,8 +275,4 @@ class DownloadsResourceTest {
void getReleaseVersion_failure_invalidReleaseType_validSchema() {
RestAssuredTemplates.testGet_validateSchema(GET_RELEASE_VERSION_INVALID_TYPE);
}
void getReleaseVersion_failure_invalidRequestFormat() {
RestAssuredTemplates.testGet(GET_RELEASE_VERSION_INVALID_FORMAT);
}
}
## DATASOURCE CONFIG
quarkus.datasource.db-kind=h2
eclipse.db.default.limit=25
eclipse.db.default.limit.max=100
eclipse.persistence.pagination-limit=25
eclipse.persistence.pagination-limit.max=100
quarkus.hibernate-orm.database.generation=none
# Flyway configuration for the default datasource
......@@ -12,9 +12,9 @@ quarkus.flyway.migrate-at-start=true
quarkus.oauth2.enabled=false
quarkus.oidc.enabled=false
quarkus.keycloak.devservices.enabled=false
quarkus.oidc-client.enabled=false
quarkus.oidc.auth-server-url=/realms/quarkus/
quarkus.oidc.client-id=quarkus-service-app
quarkus.oidc.application-type=service
smallrye.jwt.sign.key.location=privateKey.jwk
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment