Juan Hernandez has posted comments on this change.

Change subject: restapi: Move MacPool remove from collection to entity
......................................................................


Patch Set 1:

(4 comments)

https://gerrit.ovirt.org/#/c/41826/1/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/MacPoolResource.java
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/MacPoolResource.java:

Line 9: @Produces({ ApiMediaType.APPLICATION_XML, 
ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML })
Line 10: public interface MacPoolResource extends UpdatableResource<MacPool> {
Line 11: 
Line 12:     @DELETE
Line 13:     public Response remove();
Consider dropping the "public", it is implicit in interfaces.
Line 14: 


https://gerrit.ovirt.org/#/c/41826/1/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendMacPoolResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendMacPoolResource.java:

Line 46:         }
Line 47:     }
Line 48: 
Line 49:     @Override
Line 50:     @DELETE
Drop the @DELETE annotation, it already in the interface.
Line 51:     public Response remove() {
Line 52:         get();
Line 53:         return performAction(VdcActionType.RemoveMacPool, new 
RemoveMacPoolByIdParameters(asGuid(id)));
Line 54:     }


Line 49:     @Override
Line 50:     @DELETE
Line 51:     public Response remove() {
Line 52:         get();
Line 53:         return performAction(VdcActionType.RemoveMacPool, new 
RemoveMacPoolByIdParameters(asGuid(id)));
Consider using just "guid" instead of "asGuid(id)", one conversion less.
Line 54:     }


https://gerrit.ovirt.org/#/c/41826/1/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendMacPoolResourceTest.java
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendMacPoolResourceTest.java:

Line 155:     public void testRemoveNonExistant() throws Exception {
Line 156:         setUpEntityQueryExpectations(VdcQueryType.GetMacPoolById,
Line 157:                 IdQueryParameters.class,
Line 158:                 new String[] { "Id" },
Line 159:                 new Object[] { NON_EXISTANT_GUID },
I think it is better to use MAC_POOL_ID here and avoid assigning to 
resource.guid later, that way this test won't need changing if resource.guid is 
changed or its visibility changed.
Line 160:                 null);
Line 161:         control.replay();
Line 162:         try {
Line 163:             resource.guid = NON_EXISTANT_GUID;


-- 
To view, visit https://gerrit.ovirt.org/41826
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4ec4c4bd2a6abd3c2b1f05b7c5dad1443ef8779e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to