Skip to content

Commit

Permalink
remove extra import statements
Browse files Browse the repository at this point in the history
Signed-off-by: Maxwell Brown <[email protected]>
  • Loading branch information
Galactus22625 committed Oct 23, 2024
1 parent 4c01890 commit 2ebe912
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package org.opensearch.dataprepper.plugins.source.saas.jira.exception;

import net.bytebuddy.implementation.bytecode.Throw;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;


import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package org.opensearch.dataprepper.plugins.source.saas.jira.exception;

import net.bytebuddy.implementation.bytecode.Throw;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;


import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.opensearch.dataprepper.plugins.source.saas.jira.rest.auth;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opensearch.dataprepper.plugins.source.saas.jira.JiraSourceConfig;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.mockito.Mockito.when;
import static org.opensearch.dataprepper.plugins.source.saas.jira.utils.Constants.OAUTH2;

@ExtendWith(MockitoExtension.class)
public class JiraAuthFactoryTest {

@Mock
private JiraSourceConfig sourceConfig;

private JiraAuthFactory jiraAuthFactory;

@BeforeEach
void setUp() {
jiraAuthFactory = new JiraAuthFactory(sourceConfig);
}

@Test
void testGetObjectOauth2(){
when(sourceConfig.getAuthType()).thenReturn(OAUTH2);
assertInstanceOf(JiraOauthConfig.class, jiraAuthFactory.getObject());
}

@Test
void testGetObjectBasicAuth(){
assertInstanceOf(JiraBasicAuthConfig.class, jiraAuthFactory.getObject());
}

@Test
void testGetObjectType(){
assertEquals(JiraAuthConfig.class, jiraAuthFactory.getObjectType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import org.junit.jupiter.api.Test;

import javax.print.DocFlavor;

import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class ConstantsTest {
private Constants constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ExceptionUtilTest {

Expand Down

0 comments on commit 2ebe912

Please sign in to comment.