What should be tested here?

      For the HealthReportBuilder a test class already exists. In this test class, the method 

      computeHealth(final int counter, final AnnotationProvider result)
      

      is tested with 100% coverage. It computes the healthiness of a build based on the specified counter.

       

      The aim of this task is to test the whole functionallity of the builder, which includes the method 

      computeHealth(final AnnotationProvider result)

      It computes the healthiness of a build based on the specified result.

          [JENKINS-50066] Unit Test for HealthReportBuilder

          Ulli Hafner added a comment -

          SUT is io.jenkins.plugins.analysis.core.quality.HealthReportBuilder. The deprecated class hudson.plugins.analysis.core.HealthReportBuilder and the associated test should not be touched.

          I also updated the branch so that this test does not require Mockito, i.e. now the method

           
          public HealthReport computeHealth(final AnalysisResult result) 
          

          should be tested.

          You can reuse (i.e. copy) some portions of the old test if that makes sense.

          Ulli Hafner added a comment - SUT is io.jenkins.plugins.analysis.core.quality.HealthReportBuilder . The deprecated class hudson.plugins.analysis.core.HealthReportBuilder and the associated test should not be touched. I also updated the branch so that this test does not require Mockito, i.e. now the method public HealthReport computeHealth( final AnalysisResult result) should be tested. You can reuse (i.e. copy) some portions of the old test if that makes sense.

          Thank you for clarification. 

          Alexandra Wenzel added a comment - Thank you for clarification. 

          Code changed in jenkins
          User: Alexandra
          Path:
          clean.sh
          go.sh
          jenkins.sh
          skip.sh
          src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java
          src/main/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilder.java
          src/main/java/io/jenkins/plugins/analysis/core/views/ResultAction.java
          src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/578d24eef568515e08c0262d6272ff197f01f811
          Log:
          Merge pull request #2 from loelala/JENKINS-50066/UnitTest-HealthReportBuilder

          Jenkins 50066/unit test health report builder

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alexandra Path: clean.sh go.sh jenkins.sh skip.sh src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java src/main/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilder.java src/main/java/io/jenkins/plugins/analysis/core/views/ResultAction.java src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java http://jenkins-ci.org/commit/analysis-core-plugin/578d24eef568515e08c0262d6272ff197f01f811 Log: Merge pull request #2 from loelala/ JENKINS-50066 /UnitTest-HealthReportBuilder Jenkins 50066/unit test health report builder

          Code changed in jenkins
          User: loelala
          Path:
          src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/c5cb9799e4281e3ecf2d66bdf78b008b78d2e49b
          Log:
          JENKINS-50066 adjusted style, renamed some local fields and renamed method names

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: loelala Path: src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java http://jenkins-ci.org/commit/analysis-core-plugin/c5cb9799e4281e3ecf2d66bdf78b008b78d2e49b Log: JENKINS-50066 adjusted style, renamed some local fields and renamed method names

          Code changed in jenkins
          User: loelala
          Path:
          src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/80e06c37f3bdb4d5476a9f8c92b600dcdb4df949
          Log:
          Merge branch 'JENKINS-50066/UnitTest-HealthReportBuilder' into hm-edu-testing

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: loelala Path: src/test/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilderTest.java http://jenkins-ci.org/commit/analysis-core-plugin/80e06c37f3bdb4d5476a9f8c92b600dcdb4df949 Log: Merge branch ' JENKINS-50066 /UnitTest-HealthReportBuilder' into hm-edu-testing

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java
          src/main/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilder.java
          src/main/java/io/jenkins/plugins/analysis/core/views/ResultAction.java
          http://jenkins-ci.org/commit/analysis-core-plugin/85f967253db5521b766f303a294a35ead8772230
          Log:
          JENKINS-50066 Refactored parameters of computeHealth.

          Now the method does not depend on AnalysisResult anymore. It gets
          the required size values by a map.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/io/jenkins/plugins/analysis/core/model/AnalysisResult.java src/main/java/io/jenkins/plugins/analysis/core/quality/HealthReportBuilder.java src/main/java/io/jenkins/plugins/analysis/core/views/ResultAction.java http://jenkins-ci.org/commit/analysis-core-plugin/85f967253db5521b766f303a294a35ead8772230 Log: JENKINS-50066 Refactored parameters of computeHealth. Now the method does not depend on AnalysisResult anymore. It gets the required size values by a map.

            loelala Alexandra Wenzel
            drulli Ulli Hafner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: