Update Spring Boot to 2.3.2
-Update Spring Cloud to Hoxton.SR7 -Replace ResourceSupport by RepresentationModel (Spring Hateoas 1.0) -Replace ControllerLinkBuilder by WebMvcLinkBuilder (Spring Hateoas 1.0) -Move getId() from Identifiable to BaseEntity (Spring Hateoas 1.0) -Remove hamcrest.Factory -Use static Sort.by reference -Place http security anyRequest().authenticated() -Replace MockMvcRequestBuilders.fileUpload by MockMvcRequestBuilders.multipart -Deprecate MEDIA_TYPE_CBOR_UTF8 -Replace MEDIA_TYPE_CBOR_UTF8 by MEDIA_TYPE_CBOR in tests -Replace HAL_JSON_UTF8 by HAL_JSON in tests -Replace APPLICATION_JSON_UTF8 by APPLICATION_JSON in tests -Use org.mockito.junit.MockitoJUnitRunner -Remove overridden dependency versions -Removing not needed comments in pom.xml -Downgrade flyway-core to be MySQL 5.6 compatible -Add maven-site-plugin since it was removed with spring-boot 2.3 -Set servlet encoding properties -Introducing Test that verifies the charset inside the content-type of a response -Add @DirtiesContext to CorsTest and ContentTypeTest -Add content-type mockmvc test with adapted mockmvc config -Move encoding.force property to test class -Switch expected and actual parameter values in content-type test -Delete deprecated content-type test with TestRestTemplate -Exclude JUnit5 from spring-boot-starter-test -Upgrade allure-junit4 to 2.13.5 -Add aspectjweaver 1.9.6 to surefire test execution -Add flyway-core version to property -Use getRequiredLink() within MgmtBaseEntity.getId() Signed-off-by: Ammar Bikic <ammar.bikic@bosch.io>
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.json.model;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@@ -17,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
* A json annotated rest model for BaseEntity to RESTful API representation.
|
||||
*
|
||||
*/
|
||||
public abstract class MgmtBaseEntity extends ResourceSupport {
|
||||
public abstract class MgmtBaseEntity extends RepresentationModel<MgmtBaseEntity> {
|
||||
|
||||
@JsonProperty
|
||||
private String createdBy;
|
||||
@@ -31,6 +32,16 @@ public abstract class MgmtBaseEntity extends ResourceSupport {
|
||||
@JsonProperty
|
||||
private Long lastModifiedAt;
|
||||
|
||||
/**
|
||||
* Added for backwards compatibility
|
||||
*
|
||||
* @return the unique identifier of the {@link MgmtBaseEntity}.
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Link getId() {
|
||||
return this.getRequiredLink("self");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the createdBy
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class PagedList<T> extends ResourceSupport {
|
||||
public class PagedList<T> extends RepresentationModel<PagedList<T>> {
|
||||
|
||||
@JsonProperty
|
||||
private final List<T> content;
|
||||
|
||||
@@ -8,24 +8,24 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.json.model.distributionset;
|
||||
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
|
||||
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
|
||||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
|
||||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Representation of an Action Id as a Json Object with link to the Action resource
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class MgmtActionId extends ResourceSupport {
|
||||
public class MgmtActionId extends RepresentationModel<MgmtActionId> {
|
||||
|
||||
private long actionId;
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
/**
|
||||
* Response Body of Target for assignment operations.
|
||||
@@ -25,7 +26,7 @@ import org.springframework.hateoas.ResourceSupport;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class MgmtTargetAssignmentResponseBody extends ResourceSupport {
|
||||
public class MgmtTargetAssignmentResponseBody extends RepresentationModel<MgmtTargetAssignmentResponseBody> {
|
||||
|
||||
private int alreadyAssigned;
|
||||
private List<MgmtActionId> assignedActions;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package org.eclipse.hawkbit.mgmt.json.model.system;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.hateoas.RepresentationModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
@@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class MgmtSystemTenantConfigurationValue extends ResourceSupport {
|
||||
public class MgmtSystemTenantConfigurationValue extends RepresentationModel<MgmtSystemTenantConfigurationValue> {
|
||||
|
||||
@JsonInclude(Include.ALWAYS)
|
||||
private Object value;
|
||||
|
||||
Reference in New Issue
Block a user