-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing the test cases based on the new PluginConfigVariable attribute…
… used for refreshToken Signed-off-by: Santhosh Gandhe <[email protected]>
- Loading branch information
Showing
9 changed files
with
130 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...va/org/opensearch/dataprepper/plugins/source/jira/utils/MockPluginConfigVariableImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.source.jira.utils; | ||
|
||
import org.opensearch.dataprepper.model.plugin.PluginConfigVariable; | ||
|
||
/** | ||
* Mock implementation of PluginConfigVariable interface used only for Unit Testing. | ||
*/ | ||
public class MockPluginConfigVariableImpl implements PluginConfigVariable { | ||
|
||
private Object defaultValue; | ||
|
||
public MockPluginConfigVariableImpl(Object defaultValue) { | ||
this.defaultValue = defaultValue; | ||
} | ||
|
||
@Override | ||
public Object getValue() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setValue(Object someValue) { | ||
this.defaultValue = someValue; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...t/java/org/opensearch/dataprepper/plugins/source/jira/utils/TestUtilForPrivateFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
package org.opensearch.dataprepper.plugins.source.jira.utils; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
/** | ||
* Utility class to help test private fields | ||
*/ | ||
public class TestUtilForPrivateFields { | ||
|
||
// Helper method to set private fields via reflection | ||
public static void setPrivateField(Object targetObject, String fieldName, Object value) | ||
throws Exception { | ||
Field field = targetObject.getClass().getDeclaredField(fieldName); | ||
field.setAccessible(true); | ||
field.set(targetObject, value); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
...plugins/saas-source-plugins/jira-source/src/test/resources/oauth2-auth-jira-pipeline.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
hosts: ["https://jira.com/"] | ||
hosts: [ "https://jira.com/" ] | ||
authentication: | ||
oauth2: | ||
client_id: "client_id" | ||
client_secret: "client_secret" | ||
access_token: "access_token" | ||
refresh_token: "refresh_token" | ||
|