expectApiHeader method

void expectApiHeader(
  1. String apiName,
  2. String header,
  3. dynamic expected, {
  4. int? times,
})

Implementation

void expectApiHeader(
  String apiName,
  String header,
  dynamic expected, {
  int? times,
}) {
  final record = _selectApiCall(apiName, times: times);
  final headers = record.headers ?? {};
  final actual = headers[header.toLowerCase()];
  if (!_deepEquals(actual, expected)) {
    throw EnsembleTestFailure(
      'Expected API "$apiName" header "$header" = "$expected", got "$actual".',
    );
  }
}