title: How to handle login operation failure?
body: <p>I have a JUnit 5 class in my tests. I want to perform a one time login operation relevant to all tests, so I put it in the @beforeAll method.</p>
  <p>What I have done so far ,is checking the returned value for the login operation - true or false, and I check it in each test case before I start.</p>
  <pre><code>private static boolean loginSuccess;
  
  @BeforeAll
  static void beforeAll() {
      loginSuccess = feedServices.login();
  }
  
  @Test
  void myTest() {
      if(!loginSuccess){
          log.error(&quot;Failed to login&quot;);
          return;
      }
      ....
  }
  </code></pre>
  <p>Is there a more correct solution for that?</p>