From b92f9b61284900ed3cb6a9be68e9245fe1c3d70a Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Mon, 15 Jun 2020 17:16:52 +0100 Subject: [PATCH] Correct Audit Events Relationships. Previously the audit events space and organization relationships were defined as custom objects, when they should have used the standard Relationships object. This commit corrects that error. Signed-off-by: Paul Harris --- .../auditevents/ReactorAuditEventsV3Test.java | 10 +++--- .../client/v3/auditevents/AuditEvent.java | 5 +-- .../auditevents/_AuditEventRelationship.java | 36 ------------------- 3 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/_AuditEventRelationship.java diff --git a/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/auditevents/ReactorAuditEventsV3Test.java b/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/auditevents/ReactorAuditEventsV3Test.java index fed53527fc7..3e9bbe8ebc0 100644 --- a/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/auditevents/ReactorAuditEventsV3Test.java +++ b/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/auditevents/ReactorAuditEventsV3Test.java @@ -18,8 +18,8 @@ import org.cloudfoundry.client.v3.Link; import org.cloudfoundry.client.v3.Pagination; +import org.cloudfoundry.client.v3.Relationship; import org.cloudfoundry.client.v3.auditevents.AuditEventActor; -import org.cloudfoundry.client.v3.auditevents.AuditEventRelationship; import org.cloudfoundry.client.v3.auditevents.AuditEventResource; import org.cloudfoundry.client.v3.auditevents.AuditEventTarget; import org.cloudfoundry.client.v3.auditevents.GetAuditEventRequest; @@ -76,10 +76,10 @@ public void get() { .type("app") .build()) .data((Collections.singletonMap("request", null))) - .spaceRelationship(AuditEventRelationship.builder() + .spaceRelationship(Relationship.builder() .id("cb97dd25-d4f7-4185-9e6f-ad6e585c207c") .build()) - .organizationRelationship(AuditEventRelationship.builder() + .organizationRelationship(Relationship.builder() .id("d9be96f5-ea8f-4549-923f-bec882e32e3c") .build()) .link("self", Link.builder() @@ -133,10 +133,10 @@ public void list() { .type("app") .build()) .data(Collections.singletonMap("request", Collections.singletonMap("recursive", true))) - .spaceRelationship(AuditEventRelationship.builder() + .spaceRelationship(Relationship.builder() .id("cb97dd25-d4f7-4185-9e6f-ad6e585c207c") .build()) - .organizationRelationship(AuditEventRelationship.builder() + .organizationRelationship(Relationship.builder() .id("d9be96f5-ea8f-4549-923f-bec882e32e3c") .build()) .link("self", Link.builder() diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/AuditEvent.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/AuditEvent.java index 71deb22745f..1018dfbfc87 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/AuditEvent.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/AuditEvent.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.cloudfoundry.AllowNulls; import org.cloudfoundry.Nullable; +import org.cloudfoundry.client.v3.Relationship; import org.cloudfoundry.client.v3.Resource; import java.util.Map; @@ -55,14 +56,14 @@ public abstract class AuditEvent extends Resource { */ @JsonProperty("organization") @Nullable - public abstract AuditEventRelationship getOrganizationRelationship(); + public abstract Relationship getOrganizationRelationship(); /** * The space where the event occurred. */ @JsonProperty("space") @Nullable - public abstract AuditEventRelationship getSpaceRelationship(); + public abstract Relationship getSpaceRelationship(); /** * The event type diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/_AuditEventRelationship.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/_AuditEventRelationship.java deleted file mode 100644 index 357ab6eda5c..00000000000 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/auditevents/_AuditEventRelationship.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2013-2019 the original author or authors. - * - * 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 org.cloudfoundry.client.v3.auditevents; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.immutables.value.Value; - -/** - * The Audit Event relationship - */ -@JsonDeserialize -@Value.Immutable -abstract class _AuditEventRelationship { - - /** - * The relationship id - */ - @JsonProperty("guid") - abstract String getId(); - -}