From cb5fd478483c145621c281a735171eb6baa35c6e Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Tue, 19 Jan 2021 09:06:32 +0000 Subject: [PATCH] Remove unused email unpublishing adapter See here for more information about this change [1]. [1]: https://github.com/alphagov/email-alert-api/issues/1572 --- CHANGELOG.md | 4 ++++ lib/gds_api/email_alert_api.rb | 11 ----------- lib/gds_api/test_helpers/email_alert_api.rb | 5 ----- test/email_alert_api_test.rb | 18 ------------------ 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1e91ab7..2621ba46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Unreleased + +* Remove unused email unpublish adapter + # 69.1.0 * Restore find_subscriber_list adapter (for Content Tagger) diff --git a/lib/gds_api/email_alert_api.rb b/lib/gds_api/email_alert_api.rb index 9f0c25a7..2ee3155e 100644 --- a/lib/gds_api/email_alert_api.rb +++ b/lib/gds_api/email_alert_api.rb @@ -40,17 +40,6 @@ def create_message(message, headers = {}) post_json("#{endpoint}/messages", message, headers) end - # Unpublishing alert - # - # @param message [Hash] content_id - # - # Used by email-alert-service to send a message to email-alert-api - # when an unpublishing message is put on the Rabbitmq queue by - # publishing-api - def send_unpublish_message(message) - post_json("#{endpoint}/unpublish-messages", message) - end - # Get topic matches # # @param attributes [Hash] tags, links, document_type, diff --git a/lib/gds_api/test_helpers/email_alert_api.rb b/lib/gds_api/test_helpers/email_alert_api.rb index b3655e5d..46e3cb7d 100644 --- a/lib/gds_api/test_helpers/email_alert_api.rb +++ b/lib/gds_api/test_helpers/email_alert_api.rb @@ -150,11 +150,6 @@ def stub_email_alert_api_refuses_to_create_subscriber_list .to_return(status: 422) end - def stub_email_alert_api_accepts_unpublishing_message - stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/unpublish-messages") - .to_return(status: 202, body: {}.to_json) - end - def stub_email_alert_api_accepts_content_change stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/content-changes") .to_return(status: 202, body: {}.to_json) diff --git a/test/email_alert_api_test.rb b/test/email_alert_api_test.rb index c9f6a808..c1504b81 100644 --- a/test/email_alert_api_test.rb +++ b/test/email_alert_api_test.rb @@ -73,24 +73,6 @@ end end - let(:unpublish_message) do - { - "content_id" => "content-id", - } - end - - describe "unpublishing messages" do - before do - stub_email_alert_api_accepts_unpublishing_message - end - - it "sends an unpublish message" do - assert api_client.send_unpublish_message(unpublish_message) - - assert_requested(:post, "#{base_url}/unpublish-messages", body: unpublish_message.to_json) - end - end - describe "subscriptions" do describe "URI encoding ids" do it "encodes the id for #get_subscription" do