Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test google api using gock? #96

Closed
milley23 opened this issue Jan 18, 2022 · 0 comments
Closed

How to test google api using gock? #96

milley23 opened this issue Jan 18, 2022 · 0 comments

Comments

@milley23
Copy link

Hi, I am working with Google Analytics API , and need to create unit testing for that using gock. Is it possible?

how to mock this part ??
analyticsService, _ := analytics.NewService(ctx, option.WithCredentialsJSON(cred))

it asks me to put the real private key on Credential JSON or I will get this following error:
private key should be a PEM or plain PKCS1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:8 length:1214 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant