content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 09:58:26 GMT 2024
   */
  
  package com.puppycrawl.tools.checkstyle.api;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
  import com.puppycrawl.tools.checkstyle.DefaultContext;
  import com.puppycrawl.tools.checkstyle.api.AutomaticBean;
  import com.puppycrawl.tools.checkstyle.api.Configuration;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class AutomaticBean_ESTest extends AutomaticBean_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFinishLocalSetup() throws Throwable  {
        // rollbacked to evosuite
        AutomaticBean automaticBean = new AutomaticBean();
        automaticBean.finishLocalSetup();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testConfigureThrowsException0() throws Throwable  {
        // Given an AutomaticBean instance
        AutomaticBean automaticBean = new AutomaticBean();
        
        // When attempting to configure the bean with a DefaultConfiguration instance
        DefaultConfiguration arg0 = new DefaultConfiguration("iterators");
        arg0.addAttribute("com.puppycrawl.tools.checkstyle.api.AutomaticBean$RelaxedStringArrayConverter", "");
        
        try {
        // Then an exception should be thrown because the configuration is invalid
        automaticBean.configure(arg0);
        fail("Expecting exception: Exception");
        } catch (Exception e) {
        // Verify that the correct exception was thrown
        verifyException("com.puppycrawl.tools.checkstyle.api.AutomaticBean", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetupChild() throws Throwable  {
        // Given: Set up an instance of AutomaticBean with a null Configuration object
        AutomaticBean automaticBean = new AutomaticBean();
        
        // When: Call the setupChild method on the AutomaticBean instance with a null Configuration object
        automaticBean.setupChild((Configuration) null);
        
        // Then: Verify that the setupChild method does not throw an exception
        assertDoesNotThrow(() -> automaticBean.setupChild(null));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testConfigureThrowsException1() throws Throwable  {
        // No Comments were added
        AutomaticBean automaticBean = new AutomaticBean();
        DefaultConfiguration arg0 = new DefaultConfiguration("Im%qY|]4l\"uw%@");
        arg0.addAttribute("class", "");
        try { 
          automaticBean.configure(arg0);
          fail("Expecting exception: Exception");
        
        } catch(Exception e) {
           //
           // illegal value '' for property 'class' of module Im%qY|]4l\"uw%@
           //
           verifyException("com.puppycrawl.tools.checkstyle.api.AutomaticBean", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testConfigureThrowsException2() throws Throwable  {
        // Setup
        AutomaticBean automaticBean = new AutomaticBean();
        DefaultConfiguration arg0 = new DefaultConfiguration("hy");
        arg0.addChild(arg0);
        
        // Expected behavior
        IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
        automaticBean.configure(arg0);
        });
        assertEquals("hy is not allowed as a child in hy", exception.getMessage());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testConfigureThrowsException3() throws Throwable  {
        // Given
        AutomaticBean automaticBean = new AutomaticBean();
        DefaultConfiguration arg0 = new DefaultConfiguration("");
        arg0.addAttribute("", "");
        
        // When
        try {
        automaticBean.configure(arg0);
        
        // Then
        fail("Expecting exception: Exception");
        } catch(Exception e) {
        //
        // Property '' in module  does not exist, please check the documentation
        //
        verifyException("com.puppycrawl.tools.checkstyle.api.AutomaticBean", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testConfigure() throws Throwable  {
        // Given: A new instance of AutomaticBean and a DefaultConfiguration with locale "en-US"
        AutomaticBean automaticBean = new AutomaticBean();
        DefaultConfiguration arg0 = new DefaultConfiguration("en-US");
        
        // When: The configure method is called on the AutomaticBean instance with the DefaultConfiguration argument
        automaticBean.configure(arg0);
        
        // Then: The getConfiguration method should return the same object as the DefaultConfiguration argument passed in
        Configuration configuration = automaticBean.getConfiguration();
        assertSame(configuration, arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetConfigurationReturningNull() throws Throwable  {
        // Given: An instance of the AutomaticBean class is created
        AutomaticBean automaticBean = new AutomaticBean();
        
        // When: The getConfiguration method is called on the instance
        Configuration configuration = automaticBean.getConfiguration();
        
        // Then: The returned value should be null
        assertNull(configuration);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContextualize() throws Throwable  {
        // rollbacked to evosuite
        AutomaticBean automaticBean = new AutomaticBean();
        DefaultContext arg0 = new DefaultContext();
        arg0.add("name", "John Doe");
        automaticBean.contextualize(arg0);
    }
  }
  