Skip to content
Draft
Show file tree
Hide file tree
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
@@ -0,0 +1,33 @@
package com.clearfolio.viewer.lifecycle;

/**
* Durable states in the artifact-deletion receipt lifecycle.
*/
public enum ArtifactDeletionState {
/**
* An authorized deletion request has been durably accepted. The receipt may
* still carry the controlled pre-snapshot marker until an exact artifact
* checksum is captured; metadata cannot be tombstoned before that binding.
*/
DELETION_REQUESTED,

/**
* Tenant-owned job metadata has been tombstoned.
*/
METADATA_TOMBSTONED,

/**
* Exact-generation artifact cleanup is ready for a worker attempt.
*/
ARTIFACT_CLEANUP_PENDING,

/**
* Artifact cleanup completed and the receipt is terminal.
*/
ARTIFACT_CLEANUP_COMPLETED,

/**
* Artifact cleanup failed and remains eligible for a controlled retry.
*/
ARTIFACT_CLEANUP_FAILED
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.clearfolio.viewer.lifecycle;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertSame;

import org.junit.jupiter.api.Test;

/**
* Verifies the durable deletion state vocabulary used by lifecycle receipts.
*/
class ArtifactDeletionStateTest {

@Test
void exposesOnlyTheMonotonicDeletionLifecycleStates() {
ArtifactDeletionState[] expected = {
ArtifactDeletionState.DELETION_REQUESTED,
ArtifactDeletionState.METADATA_TOMBSTONED,
ArtifactDeletionState.ARTIFACT_CLEANUP_PENDING,
ArtifactDeletionState.ARTIFACT_CLEANUP_COMPLETED,
ArtifactDeletionState.ARTIFACT_CLEANUP_FAILED
};

assertArrayEquals(expected, ArtifactDeletionState.values());
for (ArtifactDeletionState state : expected) {
assertSame(state, ArtifactDeletionState.valueOf(state.name()));
}
}
}
Loading