loadMockMappings static method
Implementation
static Future<void> loadMockMappings(String mockMappingsFile) async {
TGLog.d("TGMockService.loadMockMappings()");
TGLog.d("Loading... " + mockMappingsFile);
_mockMappings = {};
if (mockMappingsFile.isNotEmpty) {
List jsonList = await TGFileUtil.readJsonFileAsList(mockMappingsFile);
List<TGMockMappingVO> mappingList = jsonList
.map<TGMockMappingVO>((json) => TGMockMappingVO.fromJson(json))
.toList();
_mockMappings = {};
for (TGMockMappingVO mockMappingVO in mappingList) {
await _saveMockMapping(mockMappingVO);
}
}
}