Skip to content

Commit

Permalink
Release 5.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski authored Sep 2, 2024
2 parents b7909c1 + d80f285 commit 27db085
Show file tree
Hide file tree
Showing 107 changed files with 7,626 additions and 356 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:

env:
GH_USER_NAME: github.actor
SCRIPTS_VERSION: 5.10.0
BOM_VERSION: 5.11.0
SCRIPTS_VERSION: 5.12.0
BOM_VERSION: 5.12.0

jobs:
release:
Expand Down
40 changes: 31 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "io.spring.dependency-management" version "1.0.9.RELEASE"
id 'java'
id 'java-library'
id "org.owasp.dependencycheck" version "5.3.1"
}

Expand All @@ -15,36 +16,57 @@ def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/

apply from: scriptsUrl + '/release-commons.gradle'
apply from: scriptsUrl + '/signing.gradle'
apply from: scriptsUrl + '/build-quality.gradle'
//apply from: scriptsUrl + '/build-quality.gradle'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

repositories {
mavenCentral { url "https://repo1.maven.org/maven2" }

if (!releaseMode) {
maven { url 'https://jitpack.io' }
}
}

dependencyManagement {
imports {
mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:efc4947e')
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.1.5.RELEASE'
mavenBom('com.epam.reportportal:commons-bom:5.12.0')
}
}

dependencies {
compile 'org.freemarker:freemarker'
compile 'ch.qos.logback:logback-classic'
compile 'org.apache.tika:tika-core'
compile 'net.coobird:thumbnailator:0.4.11'
api 'com.github.reportportal:commons-reporting:ad1f69b'
api 'org.springframework:spring-webmvc'
api 'org.springframework.security:spring-security-core'
api 'org.apache.tika:tika-core'

implementation "org.springdoc:springdoc-openapi-data-rest:${sprindocAnnotationsVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "javax.validation:validation-api:${validationApiVersion}"
implementation "org.apache.commons:commons-lang3:${commonsLangVersion}"
implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre'
implementation 'javax.servlet:javax.servlet-api'

implementation 'org.freemarker:freemarker'
implementation 'ch.qos.logback:logback-classic'
implementation 'net.coobird:thumbnailator:0.4.11'
implementation 'com.google.guava:guava'
implementation 'javax.inject:javax.inject:1'

testImplementation 'junit:junit'
// add lombok support
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"

testImplementation "junit:junit:${junitVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoJunitJupiter}"
testImplementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
testImplementation "javax.el:javax.el-api:${elApiVersion}"
testImplementation "org.glassfish:javax.el:${elApiVersion}"
}

wrapper {
gradleVersion = '6.0'
gradleVersion = '8.5'
}
13 changes: 11 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
version=5.11.1
description=EPAM Report portal. Report Portal Commons
version=5.12.0
description=EPAM Report portal common libs
hibernateValidatorVersion=6.1.2.Final
validationApiVersion=2.0.1.Final
junitVersion=4.12
elApiVersion=3.0.0
sprindocAnnotationsVersion=1.7.0
commonsLangVersion=3.9
mockitoJunitJupiter=2.23.0
jacksonVersion=2.10.2
lombokVersion=1.18.30
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Mon Mar 16 18:41:59 MSK 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/In.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;

/**
* Can be used with strings. Checks if string value is contained in allowed values ignoring case.
* <p>
* {@code null} - valid value.
*
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
@Documented
@Constraint(validatedBy = {InValidator.class, InCollectionValidator.class})
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
public @interface In {

String message() default "Value is not allowed";

Class<?>[] groups() default {};

Class<?>[] payload() default {};

String[] allowedValues() default {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
public class InCollectionValidator implements ConstraintValidator<In, Collection<String>> {

private String[] allowedValues;

@Override
public void initialize(In constraintAnnotation) {
allowedValues = new String[constraintAnnotation.allowedValues().length];
for (int i = 0; i < constraintAnnotation.allowedValues().length; i++) {
allowedValues[i] = constraintAnnotation.allowedValues()[i].toUpperCase();
}
}

@Override
public boolean isValid(Collection<String> value, ConstraintValidatorContext context) {
List<String> upperCaseList = new ArrayList<>();
for (String next : value) {
upperCaseList.add(next.toUpperCase());
}
return Arrays.asList(allowedValues).containsAll(upperCaseList);
}
}
46 changes: 46 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/InValidator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
public class InValidator implements ConstraintValidator<In, String> {

private String[] allowedValues;

@Override
public void initialize(In constraintAnnotation) {
allowedValues = constraintAnnotation.allowedValues();
}

@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
if (null == value) {
return true;
}
for (String next : allowedValues) {
if (value.equalsIgnoreCase(next)) {
return true;
}
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;

/**
* Can be used with strings. Checks if string is blank.
* <p>
* {@code null} value is valid.
*
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
@Documented
@Constraint(validatedBy = NotBlankStringValidator.class)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
public @interface NotBlankString {

String message() default "Should not be blank";

Class<?>[] groups() default {};

Class<?>[] payload() default {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;

/**
* Can be used with collection of strings. Checks if collection contains only not blank elements.
* <p>
* {@code null} - valid value. {@code empty collection} - valid value.
*
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
@Documented
@Constraint(validatedBy = NotBlankStringCollectionValidator.class)
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
public @interface NotBlankStringCollection {

String message() default "Collection should not contain blank elements";

Class<?>[] groups() default {};

Class<?>[] payload() default {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2019 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.util.Collection;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
* @author <a href="mailto:ihar_kahadouski@epam.com">Ihar Kahadouski</a>
*/
public class NotBlankStringCollectionValidator implements
ConstraintValidator<NotBlankStringCollection, Collection<String>> {

@Override
public boolean isValid(Collection<String> value, ConstraintValidatorContext context) {
if (null == value) {
return true;
}
for (String next : value) {
if (next.trim().isEmpty()) {
return false;
}
}
return true;
}
}
Loading

0 comments on commit 27db085

Please sign in to comment.