Skip to content

Commit

Permalink
test: make test more complex. create the cluster too
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilople committed Aug 29, 2023
1 parent 26e1699 commit 0999d81
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.ctrip.framework.apollo.openapi.dto.NamespaceReleaseDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenAppNamespaceDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenClusterDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenCreateAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenItemDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenNamespaceDTO;
Expand Down Expand Up @@ -134,7 +135,7 @@ public void testCreateAppButHaveNoAppRole() {

@Test
@Disabled("only for integration test")
public void testCreateAppThenCreateNamespaceThenRelease() {
public void testCreateAppThenCreateClusterCreateNamespaceThenRelease() {
// create app
final String appIdSuffix = LocalDateTime.now().format(
DateTimeFormatter.ofPattern("yyyyMMdd-HH-mm-ss")
Expand All @@ -152,6 +153,17 @@ public void testCreateAppThenCreateNamespaceThenRelease() {
assertEquals(ownerName, openAppDTO.getOwnerName());
}

// create cluster
final String clusterName = "cluster-openapi";
{
OpenClusterDTO dto = new OpenClusterDTO();
dto.setAppId(appId);
dto.setName(clusterName);
dto.setDataChangeCreatedBy(ownerName);
log.info("create cluster {}", clusterName);
client.createCluster(env, dto);
}

// create namespace
final String namespaceName = "openapi-create-namespace";
{
Expand Down

0 comments on commit 0999d81

Please sign in to comment.