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

EPMRPP-93073 migrate to Spring Boot 3 #14

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ jobs:
else
echo 'Verification failed, please check the bundle' 1>&2
exit 1
fi
fi
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ env:
- JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2

jdk:
- oraclejdk11
- oraclejdk21

cache:
directories:
- $HOME/.m2
- $HOME/.gradle

notifications:
slack: reportportal:fl6xWHVQp1jvsMmCJxYW9YKP
slack: reportportal:fl6xWHVQp1jvsMmCJxYW9YKP
26 changes: 14 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.owasp.dependencycheck.reporting.ReportGenerator
plugins {
id 'java'
id 'java-library'
id 'org.owasp.dependencycheck' version '10.0.4'
id 'org.owasp.dependencycheck' version '11.1.1'
}

def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/' +
Expand All @@ -40,24 +40,26 @@ java {
}

wrapper {
gradleVersion = '8.10'
gradleVersion = '8.11.1'
}

dependencies {
dependencies {
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}"
api "org.springdoc:springdoc-openapi-starter-common:${springDocVersion}"
api "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
api "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
api "org.apache.commons:commons-lang3:${commonsLangVersion}"
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"


testImplementation "junit:junit:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${jupiterVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${jupiterVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoJunitJupiter}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
testImplementation "javax.el:javax.el-api:${elApiVersion}"
testImplementation "org.glassfish:javax.el:${elApiVersion}"
testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation "jakarta.el:jakarta.el-api:6.0.1"
testImplementation "org.glassfish:jakarta.el:4.0.2"

// add lombok support
compileOnly "org.projectlombok:lombok:${lombokVersion}"
Expand Down
21 changes: 11 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
version=5.12.3

org.gradle.parallel=true
org.gradle.caching=true

description=EPAM Report portal. REST Reporting API model
hibernateValidatorVersion=6.1.2.Final
validationApiVersion=2.0.1.Final
junitVersion=4.12
jupiterVersion=5.8.1
elApiVersion=3.0.0
sprindocAnnotationsVersion=1.7.0
commonsLangVersion=3.9
mockitoJunitJupiter=3.4.6
jacksonVersion=2.10.2
lombokVersion=1.18.30
hibernateValidatorVersion=8.0.1.Final
junitVersion=5.11.3
mockitoJunitJupiter=5.14.2
springDocVersion=2.6.0
commonsLangVersion=3.17.0
jacksonVersion=2.18.0
lombokVersion=1.18.36
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jdk:
- openjdk21
- openjdk21
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.epam.ta.reportportal.ws.annotations;

import javax.validation.Constraint;
import jakarta.validation.Constraint;
import java.lang.annotation.*;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@

package com.epam.ta.reportportal.ws.annotations;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.ArrayList;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
*/
public class InCollectionValidator implements ConstraintValidator<In, Collection<String>> {

private String[] allowedValues;
private Set<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();
}
allowedValues = Arrays.stream(constraintAnnotation.allowedValues())
.map(String::toUpperCase)
.collect(Collectors.toSet());
}

@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);
List<String> upperCaseList = value.stream()
.map(String::toUpperCase)
.toList();

return allowedValues.containsAll(upperCaseList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.epam.ta.reportportal.ws.annotations;

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

/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.epam.ta.reportportal.ws.annotations;

import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.epam.ta.reportportal.ws.annotations;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
* Element of response for batch save operation.
*
* @author Aliaksei_Makayed
*/
@Setter
@Getter
@JsonInclude(Include.NON_NULL)
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class BatchElementCreatedRS extends EntryCreatedAsyncRS {

@JsonProperty("message")
Expand All @@ -34,39 +44,8 @@ public class BatchElementCreatedRS extends EntryCreatedAsyncRS {
@JsonProperty("stackTrace")
private String stackTrace;

public BatchElementCreatedRS() {

}

public BatchElementCreatedRS(String id) {
super.setId(id);
}

public BatchElementCreatedRS(String stackTrace, String message) {
setMessage(message);
setStackTrace(stackTrace);
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public String getStackTrace() {
return stackTrace;
}

public void setStackTrace(String stackTrace) {
this.stackTrace = stackTrace;
}

@Override
public String toString() {
return "BatchElementCreatedRS{" + "message='" + message + '\''
+ ", stackTrace='" + stackTrace + '\''
+ '}';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

/**
* Response with results of completion save batch operation.
*
* @author Aliaksei_Makayed
*/
@Setter
@Getter
@JsonInclude(Include.NON_NULL)
public class BatchSaveOperatingRS {

Expand All @@ -37,21 +41,13 @@ public BatchSaveOperatingRS() {
responses = new ArrayList<>();
}

public List<BatchElementCreatedRS> getResponses() {
return responses;
}

public void addResponse(BatchElementCreatedRS elementCreatedRS) {
responses.add(elementCreatedRS);
}

public void setResponses(List<BatchElementCreatedRS> responses) {
this.responses = responses;
}

@Override
public String toString() {
return "BatchSaveOperatingRS{" + "responses=" + responses
+ '}';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
package com.epam.ta.reportportal.ws.reporting;

import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
*/
@Setter
@Getter
public class BulkInfoUpdateRQ {

@NotNull
Expand All @@ -35,56 +39,19 @@ public class BulkInfoUpdateRQ {
@Valid
private List<UpdateItemAttributeRQ> attributes;

public List<Long> getIds() {
return ids;
}

public void setIds(List<Long> ids) {
this.ids = ids;
}

public Description getDescription() {
return description;
}

public void setDescription(Description description) {
this.description = description;
}

public List<UpdateItemAttributeRQ> getAttributes() {
return attributes;
}

public void setAttributes(List<UpdateItemAttributeRQ> attributes) {
this.attributes = attributes;
}

public enum Action {
public enum Action {
DELETE,
UPDATE,
CREATE
}

public static class Description {
@Setter
@Getter
public static class Description {

String comment;

Action action;

public String getComment() {
return comment;
}

public void setComment(String comment) {
this.comment = comment;
}

public Action getAction() {
return action;
}

public void setAction(Action action) {
this.action = action;
}
}
}
}
Loading
Loading