com.huawei.openstack4j.api.csbs.BackupManagementServiceTest Maven / Gradle / Ivy
The newest version!
package com.huawei.openstack4j.api.csbs;
import static org.testng.Assert.assertNotNull;
import java.io.IOException;
import java.util.List;
import org.testng.annotations.Test;
import com.huawei.openstack4j.api.AbstractTest;
import com.huawei.openstack4j.openstack.csbs.v1.domain.CheckPoint;
import com.huawei.openstack4j.openstack.csbs.v1.domain.CheckPointItem;
import com.huawei.openstack4j.openstack.csbs.v1.domain.CheckPointParam;
import com.huawei.openstack4j.openstack.csbs.v1.domain.CheckPointResp;
@Test
public class BackupManagementServiceTest extends AbstractTest {
@Override
protected Service service() {
return Service.CSBS;
}
private static final String CSBS_JSON = "/csbs/csbs_create.json";
private static final String CSBS_LIST_JSON = "/csbs/csbs_list.json";
@Test
public void testCreate() throws IOException {
respondWith(CSBS_JSON);
String providerId = "******";
String planId = "******";
CheckPoint checkPoint = CheckPoint
.builder()
.planId(planId)
.parameters(CheckPointParam.builder().autoTrigger(true).build())
.build();
CheckPointResp res = osv3().csbs().backups()
.create(checkPoint, providerId);
assertNotNull(res.getId());
}
@Test
public void testGet() {
respondWith(1);
Integer res = osv3().csbs().backups().get();
assertNotNull(res);
}
@Test
public void testList() throws IOException {
respondWith(CSBS_LIST_JSON);
List res = osv3().csbs().backups().list();
assertNotNull(res);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy