Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public void testAutoSavePublishedPost() throws InterruptedException {
PostModel post = createNewPost();
post.setStatus(PostStatus.PUBLISHED.toString());

testAutoSavePostOrPage(post, false);
testAutoSavePostOrPage(post, false, false);
}

@Test
Expand All @@ -677,7 +677,7 @@ public void testAutoSaveScheduledPost() throws InterruptedException {
post.setStatus(PostStatus.SCHEDULED.toString());
post.setDateCreated("2075-10-14T10:51:11+00:00");

testAutoSavePostOrPage(post, false);
testAutoSavePostOrPage(post, false, true);
}

@Test
Expand All @@ -686,10 +686,10 @@ public void testAutoSavePublishedPage() throws InterruptedException {
PostModel post = createNewPost();
post.setStatus(PostStatus.PUBLISHED.toString());

testAutoSavePostOrPage(post, true);
testAutoSavePostOrPage(post, true, false);
}

private void testAutoSavePostOrPage(PostModel post, boolean isPage) throws InterruptedException {
private void testAutoSavePostOrPage(PostModel post, boolean isPage, boolean cleanUp) throws InterruptedException {
// Arrange
setupPostAttributes(post);

Expand All @@ -707,6 +707,13 @@ private void testAutoSavePostOrPage(PostModel post, boolean isPage) throws Inter
assertNotNull(postAfterAutoSave.getAutoSaveModified());
assertNotNull(postAfterAutoSave.getAutoSavePreviewUrl());
assertNotEquals(0, postAfterAutoSave.getAutoSaveRevisionId());

// We don't want to perform the clean up unless necessary to keep the tests as quick as
// possible. However, creating for example scheduled posts during a test may affect other
// tests and hence they need to be trashed.
if (cleanUp) {
deletePost(uploadedPost);
}
}

@Test
Expand Down