private function checkMetricList($response)
{
$this->assertResponseDataHasKeys(['id', 'name' => $this->matchesRegularExpression($this->namePattern), 'alias' => $this->logicalNot($this->isEmpty()), 'scope' => $this->logicalNot($this->isEmpty())], $response, true, 'metrics');
foreach ($response['metrics'] as $id => $metric) {
$this->assertEquals($id, $metric['id']);
if ($metric['name'] == $this->testMetricName || $metric['name'] == 'Invalid-metric-Name!') {
$this->request('/scaling/metrics/xRemove', ['metrics' => json_encode([$id])], 'POST');
}
}
}