cleanup redundant code of `TestEndpoints` (#6022)
cleanup redundant code of `TestEndpoints` (#6022)

Signed-off-by: YaoZengzeng <24ab6c0308baa96f7d187360119779e115ef34f9@huawei.com>
alileza/prometheus,kangwoo/prometheus,keegancsmith/prometheus,prometheus/prometheus,GoogleCloudPlatform/prometheus,keegancsmith/prometheus,alileza/prometheus,alileza/prometheus,GoogleCloudPlatform/prometheus,alileza/prometheus,kangwoo/prometheus,kangwoo/prometheus,keegancsmith/prometheus,prometheus/prometheus,kangwoo/prometheus,GoogleCloudPlatform/prometheus,alileza/prometheus,keegancsmith/prometheus,prometheus/prometheus,prometheus/prometheus,Gouthamve/prometheus,Gouthamve/prometheus,GoogleCloudPlatform/prometheus,keegancsmith/prometheus,Gouthamve/prometheus,GoogleCloudPlatform/prometheus,prometheus/prometheus,Gouthamve/prometheus