def METHOD_NAME():
    @dataclass(frozen=True)
    class ValidImpl(AbstractExternalResource):
        def _do_deactivate(self):
            return replace(
                self,
                status=ResourceStatus(
                    state=ResourceState.DEACTIVATING,
                    message="updating",
                    managed_by=ManagedBy.RESOLVER,
                ),
            )
    deactivating = ValidImpl(
        status=ResourceStatus(
            state=ResourceState.ACTIVE,
            message="",
            managed_by=ManagedBy.RESOLVER,
        )
    ).deactivate()
    assert deactivating.status.state == ResourceState.DEACTIVATING
    @dataclass(frozen=True)
    class InvalidImpl(AbstractExternalResource):
        def _do_deactivate(self):
            return replace(
                self,
                status=ResourceStatus(
                    state=ResourceState.ACTIVE,
                    message="updating",
                    managed_by=ManagedBy.RESOLVER,
                ),
            )
    with pytest.raises(IllegalStateTransitionError):
        InvalidImpl(
            status=ResourceStatus(
                state=ResourceState.ACTIVE,
                message="",
                managed_by=ManagedBy.RESOLVER,
            )
        ).deactivate()