fix: added additional negative test cases for getApps method. feat: begin writing tests for getAppById method

This commit is contained in:
StevanFreeborn
2023-02-01 22:44:30 -06:00
parent 1d4d547c8a
commit 1a6d05a04a
4 changed files with 238 additions and 34 deletions
+20
View File
@@ -73,9 +73,29 @@ export class OnspringClient {
);
var apiResponse = await this.get<any>(endpoint);
if (apiResponse.isSuccessful === false) {
return apiResponse;
}
return apiResponse.AsGetPagedAppsResponseType();
}
public async getAppById(appId: number): Promise<ApiResponse<App>> {
const endpoint = EndpointFactory.getAppByIdEndpoint(
this._client.defaults.baseURL,
appId
);
var apiResponse = await this.get<any>(endpoint);
if (apiResponse.isSuccessful === false) {
return apiResponse;
}
return apiResponse.AsAppType();
}
/**
* @method get - Makes a GET request to the specified endpoint.
* @param {string} endpoint - The endpoint that will be used to make the request.