Commit d1039ff4 authored by Kristel Meikas's avatar Kristel Meikas
Browse files

Merge branch 'develop-2.0' into 'develop'

Develop 2.0

See merge request teis/admin-service!86
parents 98033124 3a21b47b
......@@ -4,6 +4,8 @@ stages:
- deploy
- cve-test
image: docker.repo.tehik.ee/gradle:jdk17
variables:
USE_POSTGRES: "true"
USE_RABBIT: "true"
......
......@@ -19,32 +19,24 @@ buildscript {
}
}
apply plugin: 'ee.sm.ti.teis'
allprojects {
group = "${theGroup}"
version = "${theVersion}"
apply from: this.getClass().getClassLoader().getResource('teis.sonarqube.gradle')
}
subprojects {
apply plugin: 'ee.sm.ti.teis'
functionalities {
base
}
repositories {
mavenLocal()
maven {
url "${gradle.ext.artifactoryUrl}/${gradle.ext.artifactoryRepoKey}"
credentials {
username = "${gradle.ext.artifactoryUser}"
password = "${gradle.ext.artifactoryPass}"
}
}
jcenter()
}
group = "${theGroup}"
version = "${theVersion}"
sourceCompatibility = 11
targetCompatibility = 11
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
manifest {
attributes('Implementation-Title': project.name,
......@@ -52,11 +44,6 @@ allprojects {
}
}
apply from: this.getClass().getClassLoader().getResource('teis.test-sonar.gradle')
apply from: this.getClass().getClassLoader().getResource('teis.test-jacoco.gradle')
dependencies {
compile "ee.sm.ti.teis:service-common-lib:${commonsVersion}"
compile "ee.sm.ti.teis:domain-request-lib:${commonsVersion}"
compile "ee.sm.ti.teis:common-api-gateway-lib:${commonApiGatewayVersion}"
}
}
\ No newline at end of file
}
theGroup=ee.sm.ti.teis
theVersion=1.27.1
pluginVersion=1.5.0
commonsVersion=1.37.0
commonApiGatewayVersion=1.37.0
theVersion=2.0.0-SNAPSHOT
pluginVersion=2.2.0
commonsVersion=2.4.0-SNAPSHOT
commonApiGatewayVersion=2.3.0-SNAPSHOT
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://repo.tehik.ee/artifactory/gradle-distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://repo.tehik.ee/artifactory/gradle-distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
description = """admin-service"""
functionalities {
base
microservice
database
}
......@@ -9,12 +8,11 @@ functionalities {
apply from: this.getClass().getClassLoader().getResource('teis.integrationTest.gradle')
apply from: this.getClass().getClassLoader().getResource('teis.microservice.gradle')
// Define the main class for the application
mainClassName = 'ee.sm.ti.teis.AdminServiceApp'
test {
testLogging {
events "passed", "skipped", "failed"
}
dependencies {
implementation "ee.sm.ti.teis:service-common-lib:${commonsVersion}"
implementation "ee.sm.ti.teis:domain-request-lib:${commonsVersion}"
implementation "ee.sm.ti.teis:common-api-gateway-lib:${commonApiGatewayVersion}"
}
// Define the main class for the application
mainClassName = 'ee.sm.ti.teis.AdminServiceApp'
......@@ -10,8 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import static ee.sm.ti.teis.utils.TestUtils.assertBadRequest;
import static ee.sm.ti.teis.utils.TestUtils.assertResponseNotFound;
import static org.apache.commons.lang3.RandomStringUtils.random;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testcontainers.shaded.org.apache.commons.lang.RandomStringUtils.random;
class GetFeatureFlagGwListenerTest extends AdminAppTestBase {
......
......@@ -16,8 +16,8 @@ import static ee.sm.ti.teis.servicerequest.UserType.PERSON;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_MANAGE_PARAMETERS;
import static ee.sm.ti.teis.types.enums.RolePrivilegeCode.TI_MANAGE_VIOLATION;
import static ee.sm.ti.teis.utils.TestUtils.*;
import static org.apache.commons.lang3.RandomStringUtils.random;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testcontainers.shaded.org.apache.commons.lang.RandomStringUtils.random;
@Transactional
class UpdateFeatureFlagGwListenerTest extends AdminAppTestBase {
......
......@@ -7,7 +7,7 @@ import static ee.sm.ti.teis.errors.CommonErrorCode.BAD_REQUEST;
import static ee.sm.ti.teis.types.enums.DataType.INT;
import static org.apache.commons.lang3.BooleanUtils.isTrue;
import static org.apache.commons.lang3.StringUtils.isNumeric;
import static org.springframework.util.StringUtils.isEmpty;
import static org.springframework.util.StringUtils.hasText;
public class ParameterValidationService {
......@@ -16,7 +16,7 @@ public class ParameterValidationService {
}
static void validateUpdateParameterValue(Boolean mandatory, DataType dataType, String value) {
if (isTrue(mandatory) && isEmpty(value)) {
if (isTrue(mandatory) && !hasText(value)) {
throw new TeisBusinessException(BAD_REQUEST, "Value is required");
}
......
......@@ -8,7 +8,6 @@ spring:
url: jdbc:postgresql://${DB_HOST}:5432/admin_service
username: ${DB_APP_USERNAME}
password: ${DB_APP_PASSWORD}
initialization-mode: never
liquibase:
change-log: classpath:/db/changelog/db.changelog-master.xml
user: ${DB_OWNER_USERNAME}
......
......@@ -5,6 +5,21 @@ gradle.ext.artifactoryUser = hasProperty('ARTIFACTORY_USER') ? ARTIFACTORY_USER
gradle.ext.artifactoryPass = hasProperty('ARTIFACTORY_PASS') ? ARTIFACTORY_PASS : System.getenv('ARTIFACTORY_PASS')
gradle.ext.artifactoryRepoKey = hasProperty('ARTIFACTORY_REPO_KEY') ? ARTIFACTORY_REPO_KEY : System.getenv('ARTIFACTORY_REPO_KEY')
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
repositories {
mavenLocal()
maven {
url "${gradle.ext.artifactoryUrl}/${gradle.ext.artifactoryRepoKey}"
credentials {
username = "${gradle.ext.artifactoryUser}"
password = "${gradle.ext.artifactoryPass}"
}
}
mavenCentral()
}
}
include 'service'
rootProject.name = 'admin-service'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment