package com.aventstack.extentreports.reporter;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.aventstack.extentreports.reporter.configuration.ExtentSparkReporterConfig;
import com.aventstack.extentreports.reporter.configuration.Theme;

public class SparkReporterConfigTest {
    @Test
    public void configTest() {
        ExtentSparkReporter spark = new ExtentSparkReporter("target/spark.html");
        spark.config(
                ExtentSparkReporterConfig.builder()
                        .theme(Theme.DARK)
                        .documentTitle("MyReport")
                        .build());
        Assert.assertEquals(spark.getConf().getTheme(), Theme.DARK);
        Assert.assertEquals(spark.getConf().getDocumentTitle(), "MyReport");
    }
}

@@ -41,16 +41,66 @@
 orter;%0A%0A
+import java.io.File;%0Aimport java.io.IOException;%0A%0A
 import o
@@ -823,11 +823,1865 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void loadJSONConfigFileTest() throws IOException %7B%0A        ExtentSparkReporter spark = new ExtentSparkReporter(%22target/spark.html%22);%0A        spark.loadJSONConfig(new File(%22config/spark-config.json%22));%0A        Assert.assertEquals(spark.getConf().getTheme(), Theme.STANDARD);%0A        Assert.assertEquals(spark.getConf().getDocumentTitle(), %22ExtentReports%22);%0A        Assert.assertEquals(spark.getConf().getEncoding(), %22utf-8%22);%0A    %7D%0A%0A    @Test%0A    public void loadJSONConfigStringTest() throws IOException %7B%0A        String json = %22%7B 'theme': 'DARK', 'documentTitle': 'Extent', 'encoding': 'utf-8' %7D%22;%0A        ExtentSparkReporter spark = new ExtentSparkReporter(%22target/spark.html%22);%0A        spark.loadJSONConfig(json);%0A        Assert.assertEquals(spark.getConf().getTheme(), Theme.DARK);%0A        Assert.assertEquals(spark.getConf().getDocumentTitle(), %22Extent%22);%0A        Assert.assertEquals(spark.getConf().getEncoding(), %22utf-8%22);%0A    %7D%0A%0A    @Test%0A    public void loadXMLConfigFileTest() throws IOException %7B%0A        ExtentSparkReporter spark = new ExtentSparkReporter(%22target/spark.html%22);%0A        spark.loadXMLConfig(new File(%22config/spark-config.xml%22));%0A        Assert.assertEquals(spark.getConf().getReportName(), %22Build 1%22);%0A        Assert.assertEquals(spark.getConf().getDocumentTitle(), %22Extent Framework%22);%0A        Assert.assertEquals(spark.getConf().getEncoding(), %22UTF-8%22);%0A    %7D%0A%0A    @Test%0A    public void loadXMLConfigPathTest() throws IOException %7B%0A        ExtentSparkReporter spark = new ExtentSparkReporter(%22target/spark.html%22);%0A        spark.loadXMLConfig(%22config/spark-config.xml%22);%0A        Assert.assertEquals(spark.getConf().getReportName(), %22Build 1%22);%0A        Assert.assertEquals(spark.getConf().getDocumentTitle(), %22Extent Framework%22);%0A        Assert.assertEquals(spark.getConf().getEncoding(), %22UTF-8%22);%0A    %7D
 %0A%7D%0A

Add Spark:config tests