Junit Tutorial Selenium with Java

package jUnit;
 
import org.junit.Ignore;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
 
class JunitDemo {
 
static WebDriver driver;
 
 
@Ignore // Junit 3 or Junit 4
@Test
void login() {
System.out.println("Method-1");
driver.findElement(By.name("wg")).sendKeys("Hello Junit");
}
 
@Disabled // Junit 5
@Test
void logout() {
System.out.println("Method-2");
driver.findElement(By.name("wg")).sendKeys("Hello Junit");
}
 
@Test
void techlearn() {
}
 
@Test
void google() {
driver.get("https://www.google.com");
driver.findElement(By.name("q")).sendKeys("Junit 5 Tutorial");
driver.findElement(By.name("q")).sendKeys(Keys.ENTER);
}
 
@Test
void selenium() {
}
 
@Test
void seleniumdev() throws Exception {
System.out.println("Method-2");
}
 
 
@BeforeAll
static void setUpBeforeClass() throws Exception {
System.setProperty("webdriver.chrome.driver", "G:\\Lib\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
}
 
@AfterAll
static void tearDownAfterClass() throws Exception {
driver.close();
//driver.quit();
}
 
}