From dac7902d506ca56dc00bbbcc4659767273e54e18 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 21 Sep 2023 17:35:18 -0500 Subject: [PATCH] data writer test mock fixes --- apps/forklift/test/unit/forklift/data_writer_test.exs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/forklift/test/unit/forklift/data_writer_test.exs b/apps/forklift/test/unit/forklift/data_writer_test.exs index d5c43ac2e..54aa4da73 100644 --- a/apps/forklift/test/unit/forklift/data_writer_test.exs +++ b/apps/forklift/test/unit/forklift/data_writer_test.exs @@ -93,6 +93,8 @@ defmodule Forklift.DataWriterTest do allow(Forklift.Jobs.DataMigration.compact(dataset, ingestion_id, extract_start), return: {:ok, dataset.id}) allow(Brook.Event.send(any(), event_log_published(), :forklift, any()), return: :ok) allow(Brook.Event.send(any(), data_ingest_end(), :forklift, any()), return: :ok) + allow(Redix.command!(:redix, ["GET", ingestion_id]), return: Integer.to_string(1)) + allow(Brook.Event.send(any(), ingestion_complete(), :forklift, any()), return: :ok) stub(MockTable, :write, fn _data, _params -> :ok @@ -140,6 +142,8 @@ defmodule Forklift.DataWriterTest do allow(Forklift.Jobs.DataMigration.compact(dataset, ingestion_id, extract_start), return: {:ok, dataset.id}) allow(Brook.Event.send(any(), data_ingest_end(), :forklift, dataset), return: :ok) + allow(Redix.command!(:redix, ["GET", ingestion_id]), return: Integer.to_string(1)) + allow(Brook.Event.send(any(), ingestion_complete(), :forklift, any()), return: :ok) stub(MockTable, :write, fn _data, _params -> :ok @@ -286,6 +290,8 @@ defmodule Forklift.DataWriterTest do allow(Brook.Event.send(any(), event_log_published(), :forklift, any()), return: :ok) allow(Forklift.Jobs.DataMigration.compact(dataset, ingestion_id, extract_start), return: {:ok, dataset.id}) + allow(Redix.command!(:redix, ["GET", ingestion_id]), return: Integer.to_string(1)) + allow(Brook.Event.send(any(), ingestion_complete(), :forklift, any()), return: :ok) stub(MockTable, :write, fn _data, _params -> :ok