From 5c8e6eb465334af2b719a9a1b715576beea03ec1 Mon Sep 17 00:00:00 2001 From: ColdClear <3124364150@qq.com> Date: Thu, 28 Sep 2023 18:41:53 +0800 Subject: [PATCH] remove useless code --- .../health/indicator/ArkletBaseIndicator.java | 57 ------------------- .../arklet/core/util/ConvertUtilsTests.java | 3 +- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 sofa-serverless-runtime/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/indicator/ArkletBaseIndicator.java diff --git a/sofa-serverless-runtime/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/indicator/ArkletBaseIndicator.java b/sofa-serverless-runtime/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/indicator/ArkletBaseIndicator.java deleted file mode 100644 index cd2a44256..000000000 --- a/sofa-serverless-runtime/arklet-core/src/main/java/com/alipay/sofa/serverless/arklet/core/health/indicator/ArkletBaseIndicator.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alipay.sofa.serverless.arklet.core.health.indicator; - -import com.alipay.sofa.serverless.arklet.core.health.model.Health; -import com.alipay.sofa.serverless.arklet.core.health.model.Health.HealthBuilder; - -import java.util.Map; - -/** - * @author Lunarscave - */ -public abstract class Indicator { - - private final String indicatorId; - - public Indicator(String indicatorId) { - this.indicatorId = indicatorId; - } - - /** - * get health details - * @return a map of health details - */ - protected abstract Map getHealthDetails(); - - /** - * get indicator id - * @return indicator id - */ - public String getIndicatorId() { - return indicatorId; - } - - /** - * get health model - * @param builder input health builder - * @return health model - */ - public Health getHealthModel(HealthBuilder builder) { - return builder.init().putHealthData(getIndicatorId(), getHealthDetails()).build(); - } -} diff --git a/sofa-serverless-runtime/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/util/ConvertUtilsTests.java b/sofa-serverless-runtime/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/util/ConvertUtilsTests.java index 2246a305b..a5bdc65d6 100644 --- a/sofa-serverless-runtime/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/util/ConvertUtilsTests.java +++ b/sofa-serverless-runtime/arklet-core/src/test/java/com/alipay/sofa/serverless/arklet/core/util/ConvertUtilsTests.java @@ -16,13 +16,12 @@ */ package com.alipay.sofa.serverless.arklet.core.util; -import junit.framework.TestCase; import org.junit.Assert; import org.junit.Test; import java.util.Date; -public class ConvertUtilsTests extends TestCase { +public class ConvertUtilsTests { @Test public void testBytes2Megabyte() {