-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source Pinterest: Add tests Pinterest OAuth flow (#16393)
* Add tests Pinterest OAuth flow * Add test and specify consent URL value
- Loading branch information
1 parent
cd6f997
commit 108b9d3
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
airbyte-oauth/src/test/java/io/airbyte/oauth/flows/PinterestOAuthFlowTest.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,90 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.oauth.flows; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import io.airbyte.oauth.BaseOAuthFlow; | ||
import io.airbyte.oauth.MoreOAuthParameters; | ||
import java.util.Map; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert") | ||
class PinterestOAuthFlowTest extends BaseOAuthFlowTest { | ||
|
||
@Override | ||
protected BaseOAuthFlow getOAuthFlow() { | ||
return new PinterestOAuthFlow(getConfigRepository(), getHttpClient(), this::getConstantState); | ||
} | ||
|
||
@Override | ||
protected String getExpectedConsentUrl() { | ||
return "https://pinterest.com/oauth?client_id=test_client_id&redirect_uri=https%3A%2F%2Fairbyte.io&response_type=code&scope=ads%3Aread%2Cboards%3Aread%2Cboards%3Aread_secret%2Ccatalogs%3Aread%2Cpins%3Aread%2Cpins%3Aread_secret%2Cuser_accounts%3Aread&state=state"; | ||
} | ||
|
||
@Test | ||
@Override | ||
void testEmptyOutputCompleteSourceOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testGetSourceConsentUrlEmptyOAuthSpec() {} | ||
|
||
@Test | ||
@Override | ||
void testValidateOAuthOutputFailure() {} | ||
|
||
@Test | ||
@Override | ||
void testCompleteSourceOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testEmptyInputCompleteDestinationOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testDeprecatedCompleteDestinationOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testDeprecatedCompleteSourceOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testEmptyOutputCompleteDestinationOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testCompleteDestinationOAuth() {} | ||
|
||
@Test | ||
@Override | ||
void testGetDestinationConsentUrlEmptyOAuthSpec() {} | ||
|
||
@Test | ||
@Override | ||
void testEmptyInputCompleteSourceOAuth() {} | ||
|
||
@Override | ||
protected Map<String, String> getExpectedOutput() { | ||
return Map.of( | ||
"access_token", "access_token_response", | ||
"client_id", MoreOAuthParameters.SECRET_MASK, | ||
"client_secret", MoreOAuthParameters.SECRET_MASK); | ||
} | ||
|
||
@Override | ||
protected JsonNode getCompleteOAuthOutputSpecification() { | ||
return getJsonSchema(Map.of("access_token", Map.of("type", "string"))); | ||
} | ||
|
||
@Override | ||
protected Map<String, String> getExpectedFilteredOutput() { | ||
return Map.of( | ||
"access_token", "access_token_response", | ||
"client_id", MoreOAuthParameters.SECRET_MASK); | ||
} | ||
|
||
} |