diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaServerScriptTest.java index 813a690b..d3232ecd 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/grafana/GrafanaServerScriptTest.java @@ -18,15 +18,48 @@ */ package org.apache.bigtop.manager.stack.infra.v1_0_0.grafana; +import org.apache.bigtop.manager.stack.core.spi.param.Params; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class GrafanaServerScriptTest { + private final GrafanaServerScript grafanaServerScript = new GrafanaServerScript(); + @Test public void testGetComponentName() { - GrafanaServerScript grafanaServerScript = new GrafanaServerScript(); assertEquals("grafana_server", grafanaServerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> grafanaServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> grafanaServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> grafanaServerScript.start(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> grafanaServerScript.stop(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> grafanaServerScript.status(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/mysql/MySQLServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/mysql/MySQLServerScriptTest.java index 33aab4a1..ddd40ccb 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/mysql/MySQLServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/mysql/MySQLServerScriptTest.java @@ -18,15 +18,48 @@ */ package org.apache.bigtop.manager.stack.infra.v1_0_0.mysql; +import org.apache.bigtop.manager.stack.core.spi.param.Params; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; class MySQLServerScriptTest { + + private final MySQLServerScript mysqlServerScript = new MySQLServerScript(); @Test void testGetComponentName() { - MySQLServerScript mysqlServerScript = new MySQLServerScript(); assertEquals("mysql_server", mysqlServerScript.getComponentName()); } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> mysqlServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> mysqlServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> mysqlServerScript.start(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> mysqlServerScript.stop(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> mysqlServerScript.status(params)); + } } diff --git a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusServerScriptTest.java b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusServerScriptTest.java index e506c46f..5e916787 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusServerScriptTest.java +++ b/bigtop-manager-stack/bigtop-manager-stack-infra/src/test/java/org/apache/bigtop/manager/stack/infra/v1_0_0/prometheus/PrometheusServerScriptTest.java @@ -18,15 +18,48 @@ */ package org.apache.bigtop.manager.stack.infra.v1_0_0.prometheus; +import org.apache.bigtop.manager.stack.core.spi.param.Params; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; public class PrometheusServerScriptTest { + + private final PrometheusServerScript prometheusServerScript = new PrometheusServerScript(); @Test public void testGetComponentName() { - PrometheusServerScript script = new PrometheusServerScript(); - assertEquals("prometheus_server", script.getComponentName()); + assertEquals("prometheus_server", prometheusServerScript.getComponentName()); + } + + @Test + public void testAddParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> prometheusServerScript.add(params)); + } + + @Test + public void testConfigureParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> prometheusServerScript.configure(params)); + } + + @Test + public void testStartParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> prometheusServerScript.start(params)); + } + + @Test + public void testStopParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> prometheusServerScript.stop(params)); + } + + @Test + public void testStatusParamsNull() { + Params params = null; + assertThrows(NullPointerException.class, () -> prometheusServerScript.status(params)); } }