Merge branch 'feature/hardcoded_helpers' into 'develop'
Hardcoded response testing. ### Summary Make it easy to modify json for local testing. Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/274
This commit is contained in:
commit
1aed90a1fe
@ -167,6 +167,12 @@
|
|||||||
// Send a new request to the server.
|
// Send a new request to the server.
|
||||||
[MVMCoreLoadRequestOperation sendRequest:requestForMissingData loadObject:loadObject completionHandler:^(NSDictionary * _Nullable json) {
|
[MVMCoreLoadRequestOperation sendRequest:requestForMissingData loadObject:loadObject completionHandler:^(NSDictionary * _Nullable json) {
|
||||||
|
|
||||||
|
#if ENABLE_HARD_CODED_RESPONSE
|
||||||
|
if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(modifyJSON:)]) {
|
||||||
|
json = [[MVMCoreObject sharedInstance].globalLoadDelegate modifyJSON:json];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0";
|
NSString *serverProcessTime = [(NSDictionary *)json objectChainOfKeysOrIndexes:@[@"ResponseInfo", @"timeStamp"]] ?: @"0";
|
||||||
|
|
||||||
if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) {
|
if(!self.backgroundLoad && loadObject.requestParameters.pageType && serverProcessTime) {
|
||||||
@ -291,6 +297,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_HARD_CODED_RESPONSE
|
||||||
|
if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(getJSONForPageType:)]) {
|
||||||
|
NSDictionary *json = [[MVMCoreObject sharedInstance].globalLoadDelegate getJSONForPageType:requestParameters.pageType];
|
||||||
|
completionHandler(json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
loadObject.operation.sessionTask = [[MVMCoreLoadHandler sharedGlobal] sendRequest:requestParameters locationForError:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject] requestFinished:^(id jsonObject, MVMCoreErrorObject *error) {
|
loadObject.operation.sessionTask = [[MVMCoreLoadHandler sharedGlobal] sendRequest:requestParameters locationForError:[[MVMCoreLoadHandler sharedGlobal] errorLocationForRequest:loadObject] requestFinished:^(id jsonObject, MVMCoreErrorObject *error) {
|
||||||
|
|
||||||
if ([loadObject.operation checkAndHandleForCancellation]) {
|
if ([loadObject.operation checkAndHandleForCancellation]) {
|
||||||
|
|||||||
@ -41,4 +41,9 @@
|
|||||||
/// Checks to see if the operation has content to show.
|
/// Checks to see if the operation has content to show.
|
||||||
- (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
- (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
||||||
|
|
||||||
|
#if ENABLE_HARD_CODED_RESPONSE
|
||||||
|
- (nonnull NSDictionary *)getJSONForPageType:(nonnull NSString *)pageType;
|
||||||
|
- (nonnull NSDictionary *)modifyJSON:(nonnull NSDictionary *)json;
|
||||||
|
#endif
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user