From b9c935a4c03b285d99d3f71afdaec4df62efc617 Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Wed, 6 Nov 2024 18:10:32 -0800 Subject: [PATCH] fix tests Signed-off-by: Maxwell Brown --- .../source/jira/rest/auth/JiraAuthFactoryTest.java | 1 + .../source/jira/rest/auth/JiraBasicAuthConfigTest.java | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraAuthFactoryTest.java b/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraAuthFactoryTest.java index d006f8df3f..566b3ae8ed 100644 --- a/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraAuthFactoryTest.java +++ b/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraAuthFactoryTest.java @@ -33,6 +33,7 @@ void testGetObjectOauth2() { @Test void testGetObjectBasicAuth() { + when(sourceConfig.getAccountUrl()).thenReturn("https://example.com"); assertInstanceOf(JiraBasicAuthConfig.class, jiraAuthFactory.getObject()); } diff --git a/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraBasicAuthConfigTest.java b/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraBasicAuthConfigTest.java index 917864592f..60dad25507 100644 --- a/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraBasicAuthConfigTest.java +++ b/data-prepper-plugins/saas-source-plugins/jira-source/src/test/java/org/opensearch/dataprepper/plugins/source/jira/rest/auth/JiraBasicAuthConfigTest.java @@ -17,22 +17,18 @@ public class JiraBasicAuthConfigTest { private JiraSourceConfig jiraSourceConfig; private JiraBasicAuthConfig jiraBasicAuthConfig; + String url = "https://example.com"; @BeforeEach void setUp() { + when(jiraSourceConfig.getAccountUrl()).thenReturn(url); jiraBasicAuthConfig = new JiraBasicAuthConfig(jiraSourceConfig); } @Test void testGetUrl() { - String url = "https://example.com"; - when(jiraSourceConfig.getAccountUrl()).thenReturn(url); assertEquals(jiraBasicAuthConfig.getUrl(), url + '/'); - String url2 = "https://example.com/"; - when(jiraSourceConfig.getAccountUrl()).thenReturn(url2); - assertEquals(jiraBasicAuthConfig.getUrl(), url2); - } @Test