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

sdk-java issue : "Environment not set. Set environment using setter o… #214

Closed
wants to merge 1 commit into from
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