Skip to content

Commit 75dd982

Browse files
claudecs-rajreeshika-haniket-shikhare-cstk
committed
test(branch): clean up rejected-create UIDs too
Refs: DX-31564 Co-authored-by: Raj Pandey <raj.pandey@contentstack.com> Co-authored-by: Reeshika Hosmani <reeshika.hosmani@contentstack.com> Co-authored-by: Aniket Shikhare <aniket.shikhare@contentstack.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent c370292 commit 75dd982

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/test/java/com/contentstack/cms/stack/BranchAPITest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ void createWithEmptyListClonesNoEnvironments() throws Exception {
113113
void createWithUnknownNameIsRejectedAndCreatesNoBranch() throws Exception {
114114
Response<ResponseBody> response = stack.branch()
115115
.create(body(UID_UNKNOWN, Collections.singletonList(UNKNOWN_ENV))).execute();
116+
CREATED.add(UID_UNKNOWN);
116117
assertEquals(422, response.code(), "an unknown environment name should give the API's 422");
117118
assertNotNull(response.errorBody(), "the API's error body should be present");
118119
assertTrue(response.errorBody().string().contains("publish_config.environments"),
@@ -127,6 +128,7 @@ void createWithUnknownNameIsRejectedAndCreatesNoBranch() throws Exception {
127128
void createWithMixedNamesIsRejectedAndCreatesNoBranch() throws Exception {
128129
Response<ResponseBody> response = stack.branch()
129130
.create(body(UID_MIXED, Arrays.asList(ENV_DEVELOPMENT, UNKNOWN_ENV))).execute();
131+
CREATED.add(UID_MIXED);
130132
assertEquals(422, response.code(), "a mix with an unknown name should give the API's 422");
131133
assertNotNull(response.errorBody(), "the API's error body should be present");
132134
assertTrue(response.errorBody().string().contains("publish_config.environments"),

0 commit comments

Comments
 (0)