Can I mock a stub returned by another library inside a controller method?

13 views
Skip to first unread message

Thiago Fonseca Meneses

unread,
Nov 22, 2022, 11:11:42 AM11/22/22
to wiremock-user
Hi everyone,

I'm having some technical debt. I'm able to mock some https endpoints to simulate the returned json but when that URL is used inside another library I can return my expected JSON. Do you know if this is possible?

Thiago Fonseca Meneses

unread,
Nov 22, 2022, 11:15:42 AM11/22/22
to wiremock-user
To be more clear. There are a method like this:

public String getAuthUrl()  {

OAuth2Config oauth2Config = getOAuthConfig();

var resp2 = getContentApacheHttpClientNoAuth("https://developer.xxxx/.well-known/configuration/");

}

Inside the method called by another library " getOAuthConfig()" there is a call to the exactly URL (https://developer.xxxx/.well-known/configuration/ )  that I want to stub the returned json.

 In this case, resp2 (locally) is working but getOAuthConfig is not because is called by another library?
Reply all
Reply to author
Forward
0 new messages