fixing tests
This commit is contained in:
parent
a668a1b08b
commit
6eb8d3e236
|
@ -73,7 +73,9 @@ public interface IHttpClient {
|
|||
void addHeadersToRequest(IHttpRequest theRequest, EncodingEnum theEncodingEnum, FhirContext theContext);
|
||||
|
||||
/**
|
||||
* Updates the client's url;
|
||||
* Updates the client's url, as well as the conditional create/update strings/params
|
||||
* (ie, the "if None Exists" stuff)
|
||||
*
|
||||
* This is used when we reuse a client for multiple different requests
|
||||
* (ex, searches, or fetching the /metadata endpoint followed by whatever
|
||||
* the actual endpoint is, etc).
|
||||
|
@ -81,5 +83,5 @@ public interface IHttpClient {
|
|||
* Deprecated / Legacy clients do not use this (they create new clients for
|
||||
* every request)
|
||||
*/
|
||||
void setNewUrl(StringBuilder theUrl);
|
||||
void setNewUrl(StringBuilder theUrl, String theIfNoneExistsString, Map<String, List<String>> theIfNoneExistsParams);
|
||||
}
|
||||
|
|
|
@ -143,8 +143,10 @@ public class OkHttpRestfulClient implements IHttpClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setNewUrl(StringBuilder theUrl) {
|
||||
public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map<String, List<String>> theIfNoneExistParams) {
|
||||
myUrl = theUrl;
|
||||
myIfNoneExistString = theIfNoneExistString;
|
||||
myIfNoneExistParams = theIfNoneExistParams;
|
||||
}
|
||||
|
||||
private void addHeadersToRequest(
|
||||
|
|
|
@ -38,8 +38,8 @@ import java.util.Map;
|
|||
public abstract class BaseHttpClient implements IHttpClient {
|
||||
|
||||
private final List<Header> myHeaders;
|
||||
private final Map<String, List<String>> myIfNoneExistParams;
|
||||
private final String myIfNoneExistString;
|
||||
private Map<String, List<String>> myIfNoneExistParams;
|
||||
private String myIfNoneExistString;
|
||||
protected RequestTypeEnum myRequestType;
|
||||
protected StringBuilder myUrl;
|
||||
|
||||
|
@ -60,8 +60,10 @@ public abstract class BaseHttpClient implements IHttpClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setNewUrl(StringBuilder theUrl) {
|
||||
public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map<String, List<String>> theIfNoneExistParams) {
|
||||
myUrl = theUrl;
|
||||
myIfNoneExistString = theIfNoneExistString;
|
||||
myIfNoneExistParams = theIfNoneExistParams;
|
||||
}
|
||||
|
||||
private void addHeaderIfNoneExist(IHttpRequest result) {
|
||||
|
|
|
@ -99,7 +99,7 @@ public abstract class BaseHttpClientInvocation {
|
|||
if (theParameters.getClient() != null) {
|
||||
// reuse existing client
|
||||
httpClient = theParameters.getClient();
|
||||
httpClient.setNewUrl(new StringBuilder(theParameters.getUrl()));
|
||||
httpClient.setNewUrl(new StringBuilder(theParameters.getUrl()), null, null);
|
||||
} else {
|
||||
// make a new client
|
||||
httpClient = getRestfulClientFactory()
|
||||
|
|
|
@ -145,7 +145,7 @@ abstract class BaseHttpClientInvocationWithContents extends BaseHttpClientInvoca
|
|||
httpClient = theParams.getClient();
|
||||
// update the url to the one we want (in case the
|
||||
// previous client did not have the correct one
|
||||
httpClient.setNewUrl(url);
|
||||
httpClient.setNewUrl(url, myIfNoneExistString, myIfNoneExistParams);
|
||||
} else {
|
||||
// make a new one
|
||||
httpClient = getRestfulClientFactory()
|
||||
|
|
|
@ -166,8 +166,10 @@ public class JaxRsHttpClient implements IHttpClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setNewUrl(StringBuilder theUrl) {
|
||||
public void setNewUrl(StringBuilder theUrl, String theIfNoneExistString, Map<String, List<String>> theIfNoneExistParams) {
|
||||
myUrl = theUrl;
|
||||
myIfNoneExistString = theIfNoneExistString;
|
||||
myIfNoneExistParams = theIfNoneExistParams;
|
||||
}
|
||||
|
||||
public void addHeadersToRequest(JaxRsHttpRequest theHttpRequest, EncodingEnum theEncoding, FhirContext theContext) {
|
||||
|
|
Loading…
Reference in New Issue