Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…orting into rc/5.13.0
  • Loading branch information
pbortnik committed Dec 5, 2024
2 parents bb2431b + 8939b78 commit 504c081
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@

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

import com.epam.ta.reportportal.ws.reporting.databind.OffsetDateTimeInstantSerializer;
import com.epam.ta.reportportal.ws.reporting.databind.MultiFormatDateDeserializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.time.Instant;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.time.Instant;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

/**
* JSON Representation of Report Portal's Launch domain object
Expand Down Expand Up @@ -70,17 +69,14 @@ public class LaunchResource extends OwnedResource {
@NotNull
@JsonProperty(value = "startTime", required = true)
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonSerialize(using = OffsetDateTimeInstantSerializer.class)
private Instant startTime;

@JsonProperty(value = "endTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonSerialize(using = OffsetDateTimeInstantSerializer.class)
private Instant endTime;

@JsonProperty(value = "lastModified")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonSerialize(using = OffsetDateTimeInstantSerializer.class)
private Instant lastModified;

@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright 2024 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.ta.reportportal.ws.reporting;

import com.epam.ta.reportportal.ws.reporting.databind.MultiFormatDateDeserializer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Getter;
import lombok.Setter;

import java.time.Instant;

import static com.fasterxml.jackson.annotation.JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS;

/**
* Serializes dates as long timestamp
*
* @author <a href="mailto:[email protected]">Pavel Bortnik</a>
*/
@Getter
@Setter
@JsonInclude(Include.NON_NULL)
public class LaunchResourceOld extends LaunchResource {

@JsonProperty(value = "startTime", required = true)
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonFormat(shape = Shape.NUMBER, without = WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, timezone = "UTC")
private Instant startTime;

@JsonProperty(value = "endTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonFormat(shape = Shape.NUMBER, without = WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, timezone = "UTC")
private Instant endTime;

@JsonProperty(value = "lastModified")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonFormat(shape = Shape.NUMBER, without = WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, timezone = "UTC")
private Instant lastModified;
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@

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

import com.epam.ta.reportportal.ws.reporting.databind.OffsetDateTimeInstantSerializer;
import com.epam.ta.reportportal.ws.reporting.databind.MultiFormatDateDeserializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.time.Instant;
import java.util.List;
import java.util.Set;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.Instant;
import java.util.List;
import java.util.Set;

/**
* JSON Representation of Report Portal domain object
*
Expand Down Expand Up @@ -67,12 +66,10 @@ public class TestItemResource {

@JsonProperty(value = "startTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonSerialize(using = OffsetDateTimeInstantSerializer.class)
private Instant startTime;

@JsonProperty(value = "endTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonSerialize(using = OffsetDateTimeInstantSerializer.class)
private Instant endTime;

@JsonProperty(value = "status")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2024 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.ta.reportportal.ws.reporting;

import com.epam.ta.reportportal.ws.reporting.databind.MultiFormatDateDeserializer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Getter;
import lombok.Setter;

import java.time.Instant;

import static com.fasterxml.jackson.annotation.JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS;

/**
* Serializes dates as long timestamp
*
* @author <a href="mailto:[email protected]">Pavel Bortnik</a>
*/
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TestItemResourceOld extends TestItemResource {

@JsonProperty(value = "startTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonFormat(shape = JsonFormat.Shape.NUMBER, without = WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, timezone = "UTC")
private Instant startTime;

@JsonProperty(value = "endTime")
@JsonDeserialize(using = MultiFormatDateDeserializer.class)
@JsonFormat(shape = JsonFormat.Shape.NUMBER, without = WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, timezone = "UTC")
private Instant endTime;

}

0 comments on commit 504c081

Please sign in to comment.