// Path: src/main/java/cz/jiripinkas/jsitemapgenerator/exception/WebmasterToolsException.java
// public class WebmasterToolsException extends RuntimeException {
// 
//     public WebmasterToolsException(String message, Throwable ex) {
//         super(message, ex);
//     }
// 
//     public WebmasterToolsException(String message) {
//         super(message);
//     }
// 
//     public WebmasterToolsException(Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: src/test/java/cz/jiripinkas/jsitemapgenerator/util/TestUtil.java
// public class TestUtil {
// 
// 	public static void testSitemapXsd(InputStream sitemapXml, File xsd) throws SAXException, IOException {
// 		Source xmlFile = new StreamSource(sitemapXml);
// 		SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// 		Schema schema = schemaFactory.newSchema(xsd);
// 		Validator validator = schema.newValidator();
// 		validator.validate(xmlFile);
// 	}
// 
// 	public static void testSitemapXsdFile(File file, File xsd) throws IOException, SAXException {
// 		try (FileInputStream inputStream = new FileInputStream(file)) {
// 			testSitemapXsd(inputStream, xsd);
// 		}
// 	}
// 
// }


import cz.jiripinkas.jsitemapgenerator.*;
import cz.jiripinkas.jsitemapgenerator.exception.WebmasterToolsException;
import cz.jiripinkas.jsitemapgenerator.util.TestUtil;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.jupiter.api.Assertions.*;
	}

	@Test
	void testPingGoogleSuccess2() throws Exception {
		HttpClient httpClientMock = Mockito.mock(HttpClient.class);
		SitemapGenerator sitemapGenerator = SitemapGenerator.of("https://www.example.com/");
		sitemapGenerator.setHttpClient(httpClientMock);
		Mockito.when(httpClientMock.get(Mockito.anyString()))
				.thenReturn(500);
		Mockito.when(httpClientMock.get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.example.com%2Fcustomsitemap.xml"))
				.thenReturn(200);
		sitemapGenerator.ping(Ping.builder().engines(Ping.SearchEngine.GOOGLE).sitemapUrl("customsitemap.xml").build());
		Mockito.verify(httpClientMock).get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.example.com%2Fcustomsitemap.xml");
	}

	@Test
	void testPingGoogleSuccess3() throws Exception {
		HttpClient httpClientMock = Mockito.mock(HttpClient.class);
		SitemapGenerator sitemapGenerator = SitemapGenerator.of("https://www.example.com/");
		sitemapGenerator.setHttpClient(httpClientMock);
		Mockito.when(httpClientMock.get(Mockito.anyString()))
				.thenReturn(500);
		Mockito.when(httpClientMock.get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.customdomain.com%2Fcustomsitemap.xml"))
				.thenReturn(200);
		sitemapGenerator.ping(Ping.builder().engines(Ping.SearchEngine.GOOGLE).sitemapUrl("https://www.customdomain.com/customsitemap.xml").build());
		Mockito.verify(httpClientMock).get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.customdomain.com%2Fcustomsitemap.xml");
	}

	@Test
	void testPingGoogleError1() {
// Path: src/main/java/cz/jiripinkas/jsitemapgenerator/exception/WebmasterToolsException.java
// public class WebmasterToolsException extends RuntimeException {
// 
//     public WebmasterToolsException(String message, Throwable ex) {
//         super(message, ex);
//     }
// 
//     public WebmasterToolsException(String message) {
//         super(message);
//     }
// 
//     public WebmasterToolsException(Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: src/test/java/cz/jiripinkas/jsitemapgenerator/util/TestUtil.java
// public class TestUtil {
// 
// 	public static void testSitemapXsd(InputStream sitemapXml, File xsd) throws SAXException, IOException {
// 		Source xmlFile = new StreamSource(sitemapXml);
// 		SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// 		Schema schema = schemaFactory.newSchema(xsd);
// 		Validator validator = schema.newValidator();
// 		validator.validate(xmlFile);
// 	}
// 
// 	public static void testSitemapXsdFile(File file, File xsd) throws IOException, SAXException {
// 		try (FileInputStream inputStream = new FileInputStream(file)) {
// 			testSitemapXsd(inputStream, xsd);
// 		}
// 	}
// 
// }


// Path: src/test/java/cz/jiripinkas/jsitemapgenerator/generator/SitemapGeneratorTest.java
import cz.jiripinkas.jsitemapgenerator.*;
import cz.jiripinkas.jsitemapgenerator.exception.WebmasterToolsException;
import cz.jiripinkas.jsitemapgenerator.util.TestUtil;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.jupiter.api.Assertions.*;

	}

	@Test
	void testPingGoogleSuccess2() throws Exception {
		HttpClient httpClientMock = Mockito.mock(HttpClient.class);
		SitemapGenerator sitemapGenerator = SitemapGenerator.of("https://www.example.com/");
		sitemapGenerator.setHttpClient(httpClientMock);
		Mockito.when(httpClientMock.get(Mockito.anyString()))
				.thenReturn(500);
		Mockito.when(httpClientMock.get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.example.com%2Fcustomsitemap.xml"))
				.thenReturn(200);
		sitemapGenerator.ping(Ping.builder().engines(Ping.SearchEngine.GOOGLE).sitemapUrl("customsitemap.xml").build());
		Mockito.verify(httpClientMock).get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.example.com%2Fcustomsitemap.xml");
	}

	@Test
	void testPingGoogleSuccess3() throws Exception {
		HttpClient httpClientMock = Mockito.mock(HttpClient.class);
		SitemapGenerator sitemapGenerator = SitemapGenerator.of("https://www.example.com/");
		sitemapGenerator.setHttpClient(httpClientMock);
		Mockito.when(httpClientMock.get(Mockito.anyString()))
				.thenReturn(500);
		Mockito.when(httpClientMock.get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.customdomain.com%2Fcustomsitemap.xml"))
				.thenReturn(200);
		sitemapGenerator.ping(Ping.builder().engines(Ping.SearchEngine.GOOGLE).sitemapUrl("https://www.customdomain.com/customsitemap.xml").build());
		Mockito.verify(httpClientMock).get("https://www.google.com/ping?sitemap=https%3A%2F%2Fwww.customdomain.com%2Fcustomsitemap.xml");
	}

	@Test
	void testPingGoogleError1() {
		assertThrows(WebmasterToolsException.class, () -> {