diff options
Diffstat (limited to 'node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/report/SpecVerificationReportTest.java')
-rw-r--r-- | node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/report/SpecVerificationReportTest.java | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/report/SpecVerificationReportTest.java b/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/report/SpecVerificationReportTest.java deleted file mode 100644 index 72629cc565d..00000000000 --- a/node-maintainer/src/test/java/com/yahoo/vespa/hosted/node/verification/commons/report/SpecVerificationReportTest.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.node.verification.commons.report; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.yahoo.vespa.hosted.node.verification.mock.MockCommandExecutor; -import com.yahoo.vespa.hosted.node.verification.spec.retrievers.HardwareInfo; -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -/** - * @author sgrostad - * @author olaaun - */ - -public class SpecVerificationReportTest { - - private SpecVerificationReport specVerificationReport; - private static final String REPORT_PATH = "src/test/java/com/yahoo/vespa/hosted/node/verification/spec/resources/reportJSON"; - - @Before - public void setup() { - specVerificationReport = new SpecVerificationReport(); - } - - @Test - public void VerificationReport_returns_empty_string_when_all_specs_are_correct() throws Exception { - String expectedJson = "{}"; - ObjectMapper om = new ObjectMapper(); - String actualJson = om.writeValueAsString(specVerificationReport); - assertEquals(expectedJson, actualJson); - } - - @Test - public void Json_is_in_wanted_format_when_all_specs_are_wrong() throws Exception { - specVerificationReport.setActualInterfaceSpeed(100D); - specVerificationReport.setActualDiskSpaceAvailable(500D); - specVerificationReport.setActualDiskType(HardwareInfo.DiskType.FAST); - specVerificationReport.setActualMemoryAvailable(123D); - specVerificationReport.setActualcpuCores(4); - specVerificationReport.setFaultyIpAddresses(new String[]{"2001:db8:0:1234:0:567:8:1"}); - String expectedJson = MockCommandExecutor.readFromFile(REPORT_PATH).get(0); - ObjectMapper om = new ObjectMapper(); - String actualJson = om.writeValueAsString(specVerificationReport); - assertEquals(expectedJson, actualJson); - } - -} |