title: 97.9 % Code coverage in sonarcloude and error is not covered by test Spring Project Main Application
body: <p>I am getting 97.9 % code coverage in sonarcloude and i want to make it 100%. Error is showing that my SpringProjectMainApplication.java is not covered by the test.</p>
  <p><strong>Main Class is :</strong></p>
  <pre><code>**@SpringBootApplication
  public class SpringProjectMainApplication {
      @Generated(value = { &quot;&quot; })
      public static void main(String... args) {
              SpringApplication.run(SpringProjectMainApplication.class, args);
          }
      }**
  </code></pre>
  <p><strong>Test class is</strong></p>
  <pre><code>**@SpringBootTest
  public class SpringProjectApplicationTests {
      @Test
      public void contextLoads() {
         }
  }**
  </code></pre>
  <p><strong>Sonarcloude error is :</strong></p>
  <p><a href="https://i.stack.imgur.com/V1mtE.png" rel="nofollow noreferrer">Sonarcloude </a>
  <a href="https://i.stack.imgur.com/V1mtE.png" rel="nofollow noreferrer">Sonarcloude error</a></p>
  <p>My Pom file has following configuration:</p>
  <pre><code>&lt;/sonar.sources&gt;
          &lt;sonar.issue.ignore.multicriteria&gt;e11, e12&lt;/sonar.issue.ignore.multicriteria&gt;
          &lt;!-- Disable rule for &quot;Add at least one assertion for the contextLoads 
              test case&quot; --&gt;
          &lt;sonar.issue.ignore.multicriteria.e11.ruleKey&gt;squid:S2699&lt;/sonar.issue.ignore.multicriteria.e11.ruleKey&gt;
          &lt;sonar.issue.ignore.multicriteria.e11.resourceKey&gt;**/SpringProjectApplicationTests.java&lt;/sonar.issue.ignore.multicriteria.e11.resourceKey&gt;
          &lt;!-- Disable rule for if cases in methods equals --&gt;
          &lt;sonar.issue.ignore.multicriteria.e12.ruleKey&gt;squid:S3776&lt;/sonar.issue.ignore.multicriteria.e12.ruleKey&gt;
          &lt;sonar.issue.ignore.multicriteria.e12.resourceKey&gt;**/model/**&lt;/sonar.issue.ignore.multicriteria.e12.resourceKey&gt;
           &lt;sonar.issue.ignore.multicriteria.e13.resourceKey&gt;**/SpringProjectApplicationTests.java&lt;/sonar.issue.ignore.multicriteria.e13.resourceKey&gt;
           &lt;sonar.issue.ignore.multicriteria.e13.resourceKey&gt;**/SpringProjectMainApplication.java&lt;/sonar.issue.ignore.multicriteria.e13.resourceKey&gt;
           &lt;skip.unit-tests&gt;false&lt;/skip.unit-tests&gt;
          &lt;skipITs&gt;false&lt;/skipITs&gt;
          &lt;/properties&gt;
  
  
  &lt;groupId&gt;org.sonarsource.scanner.maven&lt;/groupId&gt;
                              &lt;artifactId&gt;sonar-maven-plugin&lt;/artifactId&gt;
                              &lt;version&gt;3.6.0.1398&lt;/version&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/pluginManagement&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
                          &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
                          &lt;version&gt;0.8.4&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;excludes&gt;
                                  &lt;exclude&gt;**/model/**&lt;/exclude&gt;
                                  &lt;exclude&gt;**/SpringProjectApplication.*&lt;/exclude&gt;
                                  &lt;exclude&gt;**/config/**&lt;/exclude&gt;
                                  &lt;exclude&gt;
    **/src/it/java/SpringProjectApplicationTests.java
                                   &lt;/exclude&gt;
                              &lt;/excludes&gt;
                          &lt;/configuration&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;goals&gt;
                                      &lt;!-- binds by default to the phase &quot;initialize&quot; --&gt;
                                      &lt;goal&gt;prepare-agent&lt;/goal&gt;
                                      &lt;!-- binds by default to the phase &quot;verify&quot; --&gt;
                                      &lt;goal&gt;report&lt;/goal&gt;
  </code></pre>