Skip to content

Commit

Permalink
Merge pull request quarkusio#44033 from AmitPr/nondet-registry-serial…
Browse files Browse the repository at this point in the history
…ization

Add JsonPropertyOrder annotations to prevent order-dependent test failures
  • Loading branch information
gsmet authored Oct 24, 2024
2 parents 291e830 + 6917d50 commit c825cfb
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import io.quarkus.registry.json.JsonBuilder;

Expand All @@ -20,6 +21,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "id", "name", "description", "metadata" })
public class CategoryImpl implements Category {

private final String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

Expand All @@ -32,6 +33,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "name", "description", "metadata", "artifact", "origins" })
public class ExtensionImpl implements Extension {
private final String name;
private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

Expand All @@ -28,6 +29,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "platforms", "metadata" })
public class PlatformCatalogImpl extends JsonEntityWithAnySupport implements PlatformCatalog {

private final Map<String, Platform> platforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

Expand All @@ -24,6 +25,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "platformKey", "name", "streams", "metadata" })
public class PlatformImpl extends JsonEntityWithAnySupport implements Platform {

private final String platformKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import io.quarkus.maven.dependency.ArtifactCoords;
Expand All @@ -23,6 +24,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "version", "memberBoms", "quarkusCoreVersion", "upstreamQuarkusCoreVersion", "metadata" })
public class PlatformReleaseImpl extends JsonEntityWithAnySupport implements PlatformRelease {
private final PlatformReleaseVersion version;
private final Collection<ArtifactCoords> memberBoms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import io.quarkus.registry.json.JsonBuilder;
Expand All @@ -23,6 +24,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "id", "name", "releases", "metadata" })
public class PlatformStreamImpl extends JsonEntityWithAnySupport implements PlatformStream {
private final String id;
private final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import io.quarkus.maven.dependency.ArtifactCoords;
import io.quarkus.registry.json.JsonBuilder;
Expand All @@ -18,6 +19,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "disabled", "artifact" })
public class RegistryArtifactConfigImpl implements RegistryArtifactConfig {

protected final boolean disabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import io.quarkus.registry.json.JsonBuilder;

Expand All @@ -17,6 +18,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "id", "url" })
public class RegistryMavenRepoConfigImpl implements RegistryMavenRepoConfig {

private final String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import io.quarkus.registry.json.JsonBuilder;

Expand All @@ -19,6 +20,7 @@
* @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.
*/
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonPropertyOrder({ "recognizedVersionsExpression", "recognizedGroupIds", "exclusiveProvider" })
public class RegistryQuarkusVersionsConfigImpl implements RegistryQuarkusVersionsConfig {

private final String recognizedVersionsExpression;
Expand Down

0 comments on commit c825cfb

Please sign in to comment.