'Using BeforeMethod and SkipException produces Configuration Failure

Is it skipping my test correctly? I am not sure what Skipped Configuration means.

 @BeforeMethod

public void skipTest(){
    if (true) {
        throw new SkipException("Skipping tests");
    }
}
   

@Test
    public void sampleTest() throws IOException {
    return;

    }

   [testng] SKIPPED CONFIGURATION: @BeforeMethod skipTest

   [testng]     Sample
   [testng]     Tests run: 1, Failures: 0, Skips: 1
   [testng]     Configuration Failures: 0, Skips: 1

when i remove the beforemethod as seen below i get those results. I assume this is correct but curious why @BeforeMethod doesn't work:

@Test
    public void sampleTest() throws IOException {
   if (true) {
        throw new SkipException("Skipping tests");
    }    
    }

   [testng]     Sample
   [testng]     Tests run: 1, Failures: 0, Skips: 1


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source