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

1464129: Put guestId param in consumer json for virtWho instances #1613

Merged
merged 1 commit into from Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/spec/consumer_resource_host_guest_spec.rb
Expand Up @@ -27,7 +27,7 @@
consumer = user_cp.register(random_string('host'), :system, nil,
{}, nil, nil, [], [])
consumer.should_not be_nil
consumer['guestIds'].should be_nil
consumer['guestIds'].should == []

consumer_client = Candlepin.new(nil, nil, consumer['idCert']['cert'], consumer['idCert']['key'])
consumer_client.update_consumer({:guestIds => guests})
Expand Down
2 changes: 1 addition & 1 deletion server/spec/guestid_resource_spec.rb
Expand Up @@ -27,7 +27,7 @@
consumer = user_cp.register(random_string('host'), :system, nil,
{}, nil, nil, [], [])
consumer.should_not be_nil
consumer['guestIds'].should be_nil
consumer['guestIds'].should == []

consumer_client = Candlepin.new(nil, nil, consumer['idCert']['cert'], consumer['idCert']['key'])
consumer_client.update_guestids(guests)
Expand Down
10 changes: 10 additions & 0 deletions server/src/main/java/org/candlepin/model/Consumer.java
Expand Up @@ -791,4 +791,14 @@ public void setRecipientOwnerKey(String recipientOwnerKey) {
this.recipientOwnerKey = recipientOwnerKey;
}

/**
* This will put in the property so that the virtWho instances won't error
*
* @return List always empty
*/
@JsonProperty("guestIds")
public List getEmptyGuestIdArray() {
Copy link
Contributor

@Ceiu Ceiu Jun 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we ever going to use this property going forward? If so, does it make sense to just call this "getGuestIDs" and have it always return an empty array until we need it to do otherwise? Maybe the doc block is enough documentation here.

return new ArrayList<String>();
}

}