content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 15:47:00 GMT 2024
   */
  
  package twitter4j;
  
  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 org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import twitter4j.HttpParameter;
  import twitter4j.OEmbedRequest;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class OEmbedRequest_ESTest extends OEmbedRequest_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        // No Comments were added
        OEmbedRequest oEmbedRequest = new OEmbedRequest(0L, "H^ J`\"T0A7zSM8");
        String string = oEmbedRequest.toString();
        assertEquals("OEmbedRequest{statusId=0, url='H^ J`\"T0A7zSM8', maxWidth=0, hideMedia=true, hideThread=true, omitScript=false, align=NONE, related=[], lang='null'}", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCodeAndRelated() throws Throwable  {
        // Create a new instance of OEmbedRequest with an id and a title
        OEmbedRequest oEmbedRequest = new OEmbedRequest(-835L, "n");
        
        // Set the related property to null
        oEmbedRequest.related((String[]) null);
        
        // Call the hashCode method on the instance of OEmbedRequest
        oEmbedRequest.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode0() throws Throwable  {
        // rollbacked to evosuite
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-3L), "*");
        oEmbedRequest.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode1() throws Throwable  {
        // No Comments were added
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-566L), (String) null);
        oEmbedRequest.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndEqualsWithNonNull0() throws Throwable  {
        // Given two OEmbedRequest objects with different ids
        OEmbedRequest oEmbedRequest = new OEmbedRequest(-3587L, "P7");
        OEmbedRequest arg0 = new OEmbedRequest(-3587L, "J");
        
        // When the equals method is called with one of these objects as an argument
        boolean equals = oEmbedRequest.equals(arg0);
        
        // Then the result should be false, since the ids are different
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndEqualsWithNonNull1() throws Throwable  {
        // Given an OEmbedRequest object "oEmbedRequest" with a valid URL (-1L) and an invalid string ("vFYb!E,m1h")
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-1L), "vFYb!E,m1h");
        
        // When we create a new OEmbedRequest object with the same URL (-1L) and an invalid string (null)
        OEmbedRequest arg0 = new OEmbedRequest((-1L), (String) null);
        
        // Then we expect that the "equals" method will return false, as the two objects have different values for their url and text fields
        boolean equals = oEmbedRequest.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetLangWithEmptyString() throws Throwable  {
        // Given two instances of OEmbedRequest with the same ID and language
        OEmbedRequest oEmbedRequest1 = new OEmbedRequest(1853L, "");
        OEmbedRequest oEmbedRequest2 = new OEmbedRequest(1853L, "");
        
        // When we check if they are equal
        boolean equals = oEmbedRequest1.equals(oEmbedRequest2);
        
        // Then the result is true
        assertTrue(equals);
        
        // And when we set one of them to have a different language
        oEmbedRequest2.setLang("");
        
        // Then the equals method returns false
        assertFalse(oEmbedRequest1.equals(oEmbedRequest2));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetLangWithNonEmptyString() throws Throwable  {
        // No Comments were added
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1819L, "Pn");
        OEmbedRequest lang = oEmbedRequest.lang("Pn");
        OEmbedRequest arg0 = new OEmbedRequest(1819L, "Pn");
        assertFalse(arg0.equals((Object)oEmbedRequest));
        
        arg0.setLang("Pn");
        boolean equals = oEmbedRequest.equals(arg0);
        assertTrue(arg0.equals((Object)lang));
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndLang() throws Throwable  {
        // Create two OEmbedRequest objects with different languages
        OEmbedRequest request1 = new OEmbedRequest(1819L, "Pn");
        request1.lang("Pn");
        OEmbedRequest request2 = new OEmbedRequest(1819L, "Pn");
        request2.lang("En");
        
        // Test that the objects are not equal despite having the same ID and type
        assertFalse(request1.equals(request2));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndEqualsWithNonNull2() throws Throwable  {
        // No Comments were added
        OEmbedRequest arg0 = new OEmbedRequest(0L, "H^ J`\"T0A7zSM8");
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-1199L), "");
        boolean equals = oEmbedRequest.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndOmitScript() throws Throwable  {
        // No Comments were added
        OEmbedRequest arg0 = new OEmbedRequest(1L, "6Qb(#+%H7*n");
        OEmbedRequest oEmbedRequest = new OEmbedRequest(699L, "H^ J`\"T0A7zSM8");
        arg0.omitScript(true);
        boolean equals = oEmbedRequest.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEquals() throws Throwable  {
        // Given
        OEmbedRequest oEmbedRequest = new OEmbedRequest(-3721L, "lN#+L");
        
        // When
        boolean equals = oEmbedRequest.equals("lN#+L");
        
        // Then
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNull() throws Throwable  {
        // Given an OEmbedRequest object for a specific video id (1863L)
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1863L, null);
        
        // When the equals method is called with a null argument
        boolean equals = oEmbedRequest.equals((Object) null);
        
        // Then it should return false to indicate that the objects are not equal
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue() throws Throwable  {
        // Given: An OEmbedRequest object with an ID of 1833 and a type of "Pn"
        OEmbedRequest request = new OEmbedRequest(1833L, "Pn");
        
        // When: The equals method is called on the same OEmbedRequest object twice
        boolean equals = request.equals(request);
        assertTrue(equals);
        
        // Then: The first call to the equals method should return true, as the objects are equal
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAsHttpParameterArray() throws Throwable  {
        // Create an instance of OEmbedRequest with a negative value for the id parameter
        OEmbedRequest oEmbedRequest = new OEmbedRequest(-1199L, "");
        
        // Retrieve an array of HttpParameters from the OEmbedRequest object
        HttpParameter[] asHttpParameterArray = oEmbedRequest.asHttpParameterArray();
        
        // Verify that the length of the array is 6
        assertEquals(6, asHttpParameterArray.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAlign() throws Throwable  {
        // Given a request to retrieve an OEmbed resource
        OEmbedRequest oEmbedRequest = new OEmbedRequest(-3L, "*");
        
        // When the alignment parameter is set to null
        oEmbedRequest.align((OEmbedRequest.Align) null);
        
        // Then the hashCode method should return a non-zero value
        assertNotEquals(0, oEmbedRequest.hashCode());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetHideThread() throws Throwable  {
        // Given: An OEmbedRequest object is created with a thread ID and a name
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1833L, "Pn");
        
        // When: The hideThread property is set to false
        oEmbedRequest.setHideThread(false);
        
        // Then: The equals method returns false when comparing the same object with different values for the hideThread property
        OEmbedRequest arg0 = new OEmbedRequest(1833L, "Pn");
        boolean equals = oEmbedRequest.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHideMedia() throws Throwable  {
        // Given: A OEmbedRequest object with a video ID and an embed code
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1L, "%2a");
        
        // When: The hide media flag is set to false
        oEmbedRequest.HideMedia(false);
        
        // Then: The hashCode method should return a valid value
        assertNotEquals(0, oEmbedRequest.hashCode());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetOmitScript() throws Throwable  {
        // No Comments were added
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-2345L), "WH&c>D^:t;9G|Lm");
        oEmbedRequest.setOmitScript(true);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCodeAndLang() throws Throwable  {
        // Create a new instance of OEmbedRequest with the id 0 and type "RIGHT"
        OEmbedRequest oEmbedRequest = new OEmbedRequest(0L, "RIGHT");
        
        // Set the language of the request to "q" using the lang() method
        OEmbedRequest lang = oEmbedRequest.lang("q");
        
        // Calculate the hash code of the request
        int hashCode = lang.hashCode();
        
        // Assert that the hash code is equal to 0
        assertEquals(0, hashCode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMaxWidth() throws Throwable  {
        // Given two instances of the OEmbedRequest class with different values for maxWidth
        OEmbedRequest oEmbedRequest1 = new OEmbedRequest(0L, "RIGHT");
        OEmbedRequest oEmbedRequest2 = new OEmbedRequest((-1L), "RIGHT");
        
        // When we call the equals method on these instances with one another
        boolean equals = oEmbedRequest1.equals(oEmbedRequest2);
        
        // Then they should not be equal
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaxWidth() throws Throwable  {
        // No Comments were added
        OEmbedRequest oEmbedRequest = new OEmbedRequest((-56L), "UTF-8");
        oEmbedRequest.setMaxWidth((-1360));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCodeAndOmitScript() throws Throwable  {
        // Arrange
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1L, "6Qb(#+%H7*n");
        // Act
        int hashCode = oEmbedRequest.hashCode();
        // Assert
        assertEquals(325409, hashCode);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetRelated() throws Throwable  {
        // Given: We have an OEmbedRequest object with a specific id and related objects
        OEmbedRequest oembedRequest = new OEmbedRequest(2600L, "J");
        String[] relatedObjects = new String[1];
        oembedRequest.setRelated(relatedObjects);
        
        // When: We call the asHttpParameterArray method on the OEmbedRequest object
        HttpParameter[] httpParameters = oembedRequest.asHttpParameterArray();
        
        // Then: The resulting array of HTTP parameters should have a length of 8
        assertEquals(8, httpParameters.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetHideMedia() throws Throwable  {
        // Given: Two OEmbedRequest objects with different hide media settings
        OEmbedRequest oEmbedRequest1 = new OEmbedRequest(1833L, "Pn");
        oEmbedRequest1.setHideMedia(false);
        OEmbedRequest oEmbedRequest2 = new OEmbedRequest(1833L, "Pn");
        oEmbedRequest2.setHideMedia(true);
        
        // When: We compare these two objects with the equals method
        boolean equals = oEmbedRequest1.equals(oEmbedRequest2);
        
        // Then: The objects are not equal
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRelatedAndToString() throws Throwable  {
        // Given a user with ID 527 and an URL "L?"
        OEmbedRequest oEmbedRequest = new OEmbedRequest(527L, "L?");
        
        // When the related field is set to null
        oEmbedRequest.related((String[]) null);
        
        // Then the toString method should return a string representation of the object with the correct values
        String string = oEmbedRequest.toString();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHideThread() throws Throwable  {
        // rollbacked to evosuite
        OEmbedRequest oEmbedRequest = new OEmbedRequest(1L, "%2a");
        oEmbedRequest.HideThread(false);
        oEmbedRequest.hashCode();
    }
  }
  