content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 11:28:52 GMT 2024
   */
  
  package org.heal.module.search;
  
  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.microsoft.jdbcx.base.BaseXADataSource;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.heal.module.search.AdvSearchDAO;
  import org.heal.module.search.ParameterBean;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class AdvSearchDAO_Original_ESTest extends AdvSearchDAO_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAdvSearchThrowsNullPointerException() throws Throwable  {
        ParameterBean arg0 = new ParameterBean("Metadata.PublicationId IN (SELECT Publications.PublicationId FROM Publications WHERE PublicationName LIKE '");
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        // Undeclared exception!
        try { 
          advSearchDAO.AdvSearch(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.heal.module.search.AdvSearchDAO", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMultiSelectionReturningEmptyString() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String[] arg0 = new String[0];
        String multiSelection = advSearchDAO.getMultiSelection(arg0, "CopyRights");
        assertEquals("", multiSelection);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMultiSelectionReturningNonEmptyString() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String[] arg0 = new String[8];
        String multiSelection = advSearchDAO.getMultiSelection(arg0, "CopyRights");
        assertEquals("CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' OR CopyRights like '%null%' ", multiSelection);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMakeQueryThrowsNullPointerException() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        ParameterBean arg0 = new ParameterBean("all");
        arg0.setHidden(true);
        // Undeclared exception!
        try { 
          advSearchDAO.makeQuery(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.heal.module.search.AdvSearchDAO", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQuery0() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery("Transliteration table {0} not found.", "Transliteration table {0} not found.", "Transliteration table {0} not found.", "Specified parameter values not supported for method: {0}", " \nUNION ");
        assertEquals("SELECT Transliteration table {0} not found..metadataID from Transliteration table {0} not found. WHERE Transliteration table {0} not found. IN (Select Transliteration table {0} not found. from Specified parameter values not supported for method: {0} WHERE  \nUNION  like 'Transliteration%' OR  \nUNION  like '% Transliteration%'  AND Transliteration table {0} not found. IN (SELECT Transliteration table {0} not found. FROM Specified parameter values not supported for method: {0} WHERE  \nUNION  like 'table%' OR  \nUNION  like '% table%' ) AND Transliteration table {0} not found. IN (SELECT Transliteration table {0} not found. FROM Specified parameter values not supported for method: {0} WHERE  \nUNION  like '{0}%' OR  \nUNION  like '% {0}%' ) AND Transliteration table {0} not found. NOT IN (SELECT Transliteration table {0} not found. FROM Specified parameter values not supported for method: {0} WHERE  \nUNION  like 'found.%' OR  \nUNION  like '% found.%' ))", buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQuery1() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery(" AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))");
        assertNotNull(buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQuery2() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery("SELECT =$FG{b.>h)aC^: 3.metadataID from =$FG{b.>h)aC^: 3 WHERE =$FG{b.>h)aC^: 3 like '=$FG{b.>h)aC^:%' OR =$FG{b.>h)aC^: 3 like '% =$FG{b.>h)aC^:%'  AND Metadata.metadataID IN (SELECT =$FG{b.>h)aC^: 3.MetadataID from =$FG{b.>h)aC^: 3 where =$FG{b.>h)aC^: 3 like '3%' OR =$FG{b.>h)aC^: 3 like '% 3%' )", "SELECT =$FG{b.>h)aC^: 3.metadataID from =$FG{b.>h)aC^: 3 WHERE =$FG{b.>h)aC^: 3 like '=$FG{b.>h)aC^:%' OR =$FG{b.>h)aC^: 3 like '% =$FG{b.>h)aC^:%'  AND Metadata.metadataID IN (SELECT =$FG{b.>h)aC^: 3.MetadataID from =$FG{b.>h)aC^: 3 where =$FG{b.>h)aC^: 3 like '3%' OR =$FG{b.>h)aC^: 3 like '% 3%' )", "SELECT =$FG{b.>h)aC^: 3.metadataID from =$FG{b.>h)aC^: 3 WHERE =$FG{b.>h)aC^: 3 like '=$FG{b.>h)aC^:%' OR =$FG{b.>h)aC^: 3 like '% =$FG{b.>h)aC^:%'  AND Metadata.metadataID IN (SELECT =$FG{b.>h)aC^: 3.MetadataID from =$FG{b.>h)aC^: 3 where =$FG{b.>h)aC^: 3 like '3%' OR =$FG{b.>h)aC^: 3 like '% 3%' )", "SELECT =$FG{b.>h)aC^: 3.metadataID from =$FG{b.>h)aC^: 3 WHERE =$FG{b.>h)aC^: 3 like '=$FG{b.>h)aC^:%' OR =$FG{b.>h)aC^: 3 like '% =$FG{b.>h)aC^:%'  AND Metadata.metadataID IN (SELECT =$FG{b.>h)aC^: 3.MetadataID from =$FG{b.>h)aC^: 3 where =$FG{b.>h)aC^: 3 like '3%' OR =$FG{b.>h)aC^: 3 like '% 3%' )", "SELECT =$FG{b.>h)aC^: 3.metadataID from =$FG{b.>h)aC^: 3 WHERE =$FG{b.>h)aC^: 3 like '=$FG{b.>h)aC^:%' OR =$FG{b.>h)aC^: 3 like '% =$FG{b.>h)aC^:%'  AND Metadata.metadataID IN (SELECT =$FG{b.>h)aC^: 3.MetadataID from =$FG{b.>h)aC^: 3 where =$FG{b.>h)aC^: 3 like '3%' OR =$FG{b.>h)aC^: 3 like '% 3%' )");
        assertNotNull(buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQuery3() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery("(", "(", "#m[;4pb", "(", "K4O< ");
        assertEquals("SELECT #m[;4pb.metadataID from #m[;4pb WHERE ( IN (Select ( from ( WHERE ( )", buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQueryWithNullAndNull() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery("SELECT \".metadataID from \" WHERE OQrQvxK $ like ';password=%' OR OQrQvxK $ like '% ;password=%' ", (String) null, "mgL6:dtG_sz;IT", (String) null, "OQrQvxK $");
        assertEquals("SELECT mgL6:dtG_sz;IT.metadataID from mgL6:dtG_sz;IT WHERE null IN (Select null from null WHERE OQrQvxK $ like 'SELECT%' OR OQrQvxK $ like '% SELECT%'  AND null IN (SELECT null FROM null WHERE OQrQvxK $ like '\".metadataID%' OR OQrQvxK $ like '% \".metadataID%' ) AND null IN (SELECT null FROM null WHERE OQrQvxK $ like 'from%' OR OQrQvxK $ like '% from%' ) AND null IN (SELECT null FROM null WHERE OQrQvxK $ like '% and WHERE and OQrQvxK and $ and like and ';password=%' and OR and OQrQvxK and $ and like and '% and %' OR OQrQvxK $ like '% and WHERE and OQrQvxK and $ and like and ';password=%' and OR and OQrQvxK and $ and like and '% and%' OR OQrQvxK $ like '% and WHERE and OQrQvxK and $ and like and ';password=%' and OR and OQrQvxK and $ and like and '% and %'))", buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildMutiQuery4() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildMutiQuery = advSearchDAO.buildMutiQuery("SELECT  \" .metadataID from  \"  WHERE cQrQvxN $ like ';password=%' OR cQrQvxN $ like '% ;password=%' ", "mgL6dtG_sz;IT", " \" ", "mgL6dtG_sz;IT", "wD2*<nA@?");
        assertNotNull(buildMutiQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQuery0() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery("Transliteration table {0} not found.", "Transliteration table {0} not found.", "Transliteration table {0} not found.");
        assertEquals("SELECT Transliteration table {0} not found..metadataID from Transliteration table {0} not found. WHERE Transliteration table {0} not found. like 'Transliteration%' OR Transliteration table {0} not found. like '% Transliteration%'  AND Metadata.metadataID IN (SELECT Transliteration table {0} not found..MetadataID from Transliteration table {0} not found. where Transliteration table {0} not found. like 'table%' OR Transliteration table {0} not found. like '% table%' ) AND Metadata.metadataID IN (SELECT Transliteration table {0} not found..MetadataID from Transliteration table {0} not found. where Transliteration table {0} not found. like '{0}%' OR Transliteration table {0} not found. like '% {0}%' ) AND Metadata.metadataID NOT IN (SELECT Transliteration table {0} not found..MetadataID from Transliteration table {0} not found. where Transliteration table {0} not found. like 'found.%' OR Transliteration table {0} not found. like '% found.%' )", buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQuery1() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery(" AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))", " AND Metadata.MetadataID NOT IN (select MetadataID from TargetUserGroups where (TargetUserGroup = 'Consumer Health/Patient Education' or TargetUserGroup = 'K-12') AND MetadataID NOT IN (select MetadataID from TargetUserGroups where TargetUserGroup = 'Higher Education' or TargetUserGroup ='Health Profession Education'))");
        assertNotNull(buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQuery2() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery("SELECT :@e.9|3fug.metadataID from :@e.9|3fug WHERE null like 'Discarded%' OR null like '% Discarded%'  AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'ResultSet%' OR null like '% ResultSet%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'during%' OR null like '% during%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'executeUpdate.%' OR null like '% executeUpdate.%' )", "SELECT :@e.9|3fug.metadataID from :@e.9|3fug WHERE null like 'Discarded%' OR null like '% Discarded%'  AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'ResultSet%' OR null like '% ResultSet%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'during%' OR null like '% during%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'executeUpdate.%' OR null like '% executeUpdate.%' )", "SELECT :@e.9|3fug.metadataID from :@e.9|3fug WHERE null like 'Discarded%' OR null like '% Discarded%'  AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'ResultSet%' OR null like '% ResultSet%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'during%' OR null like '% during%' ) AND Metadata.metadataID IN (SELECT :@e.9|3fug.MetadataID from :@e.9|3fug where null like 'executeUpdate.%' OR null like '% executeUpdate.%' )");
        assertNotNull(buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQueryWithNull() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery("(", (String) null, "\"SH~%t");
        assertEquals("SELECT \"SH~%t.metadataID from \"SH~%t WHERE ( ", buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQuery3() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery("SELECT \".metadataID from \" WHERE OQrQvxK $ like 'mgL6:dtG_sz;IT%' OR OQrQvxK $ like '% mgL6:dtG_sz;IT%' ", "SELECT \".metadataID from \" WHERE OQrQvxK $ like 'mgL6:dtG_sz;IT%' OR OQrQvxK $ like '% mgL6:dtG_sz;IT%' ", "OQrQvxK $");
        assertNotNull(buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildCommonQuery4() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String buildCommonQuery = advSearchDAO.buildCommonQuery("SELECT  \" .metadataID from  \"  WHERE ;password= IN (Select ;password= from OQrQvxK $ WHERE Vz-A8#ZV like 'OQrQvxK%' OR Vz-A8#ZV like '% OQrQvxK%'  AND ;password= IN (SELECT ;password= FROM OQrQvxK $ WHERE Vz-A8#ZV like '$%' OR Vz-A8#ZV like '% $%' ))", "6H{,v  RY'", "6H{,v  RY'");
        assertNotNull(buildCommonQuery);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddDefaultConnectives0() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String addDefaultConnectives = advSearchDAO.addDefaultConnectives("The  and specified  and SQL  and type  and is not supported  and by  and this  and driver. ");
        assertEquals("The and specified and SQL and type and is not supported and by and this and driver. ", addDefaultConnectives);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddDefaultConnectives1() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String addDefaultConnectives = advSearchDAO.addDefaultConnectives("Error closing Blob or Clob object.");
        assertEquals("Error  and closing  and Blob or Clob  and object. ", addDefaultConnectives);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddDefaultConnectivesReturningEmptyString() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        String addDefaultConnectives = advSearchDAO.addDefaultConnectives("");
        assertEquals("", addDefaultConnectives);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDataSource() throws Throwable  {
        AdvSearchDAO advSearchDAO = new AdvSearchDAO();
        BaseXADataSource arg0 = new BaseXADataSource();
        advSearchDAO.setDataSource(arg0);
        assertNull(arg0.getSpyAttributes());
    }
  }
  