/** * Use {@link #createCompositeDesc(boolean, ServiceDocument...)} instead! */ @Deprecated protected CompositeDescriptionService.CompositeDescription createCompositeDesc( boolean isCloned, ResourceType type, ServiceDocument... descs) throws Throwable { CompositeDescriptionService.CompositeDescription compositeDesc = TestRequestStateFactory .createCompositeDescription(isCloned); for (ServiceDocument desc : descs) { desc.documentSelfLink = UUID.randomUUID().toString(); if (type == ResourceType.CONTAINER_TYPE) { desc = doPost(desc, ContainerDescriptionService.FACTORY_LINK); } else { desc = doPost(desc, ComputeDescriptionService.FACTORY_LINK); } addForDeletion(desc); compositeDesc.descriptionLinks.add(desc.documentSelfLink); } compositeDesc = doPost(compositeDesc, CompositeDescriptionFactoryService.SELF_LINK); addForDeletion(compositeDesc); return compositeDesc; }
protected CompositeDescriptionService.CompositeDescription createCompositeDesc( boolean isCloned, boolean overrideSelfLink, ServiceDocument... descs) throws Throwable { CompositeDescriptionService.CompositeDescription compositeDesc = TestRequestStateFactory .createCompositeDescription(isCloned); for (ServiceDocument desc : descs) { if (overrideSelfLink || desc.documentSelfLink == null) { desc.documentSelfLink = UUID.randomUUID().toString(); } if (desc instanceof ContainerDescriptionService.ContainerDescription) { desc = doPost(desc, ContainerDescriptionService.FACTORY_LINK); } else if (desc instanceof ContainerNetworkDescriptionService.ContainerNetworkDescription) { desc = doPost(desc, ContainerNetworkDescriptionService.FACTORY_LINK); } else if (desc instanceof ComputeDescriptionService.ComputeDescription) { desc = doPost(desc, ComputeDescriptionService.FACTORY_LINK); } else if (desc instanceof ContainerVolumeDescriptionService.ContainerVolumeDescription) { desc = doPost(desc, ContainerVolumeDescriptionService.FACTORY_LINK); } else if (desc instanceof LoadBalancerDescriptionService.LoadBalancerDescription) { desc = doPost(desc, LoadBalancerDescriptionService.FACTORY_LINK); } else { throw new IllegalArgumentException( "Unknown description type: " + desc.getClass().getSimpleName()); } addForDeletion(desc); compositeDesc.descriptionLinks.add(desc.documentSelfLink); } compositeDesc = doPost(compositeDesc, CompositeDescriptionFactoryService.SELF_LINK); addForDeletion(compositeDesc); return compositeDesc; }