Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ public S executeWithApiResponse(Environment environment) {
return this.getApiResponse();
}

final String nullEnvironmentErrorMessage = "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment";

public void execute() {
if ( null == ApiOperationBase.getEnvironment())
{
throw new InvalidParameterException(nullEnvironmentErrorMessage);
throw new InvalidParameterException(Constants.NULL_ENVIRONMENT_ERROR_MESSAGE);
}
else
{
Expand All @@ -139,7 +138,7 @@ public void execute(Environment environment) {

logger.debug(String.format("Executing Request:'%s'", this.getApiRequest()));

if ( null == environment) throw new InvalidParameterException(nullEnvironmentErrorMessage);
if ( null == environment) throw new InvalidParameterException(Constants.NULL_ENVIRONMENT_ERROR_MESSAGE);

ANetApiResponse httpApiResponse = HttpUtility.postData(environment, this.getApiRequest(), this.responseClass);
if ( null != httpApiResponse)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/authorize/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ public final class Constants {
public static final int HTTP_READ_TIME_OUT_DEFAULT_VALUE = 30000;

public static final String CLIENT_ID = "sdk-java-2.0.3";
public static final String NULL_ENVIRONMENT_ERROR_MESSAGE = "Environment not set. Set environment using setter or use overloaded method to pass appropriate environment";

}
Loading