content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 16:08:22 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 static org.evosuite.runtime.EvoAssertions.*;
  import java.io.InputStream;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import twitter4j.TwitterImpl;
  import twitter4j.auth.Authorization;
  import twitter4j.auth.BasicAuthorization;
  import twitter4j.auth.OAuth2Authorization;
  import twitter4j.auth.OAuthAuthorization;
  import twitter4j.conf.PropertyConfiguration;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class TwitterImpl_ESTest extends TwitterImpl_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUserListMembershipsThrowsException() throws Throwable  {
        // Given: A valid TwitterImpl instance and a list of users to retrieve memberships for
        BasicAuthorization basicAuth = new BasicAuthorization(")rm|yNr9_-+", ")rm|yNr9_-+");
        PropertyConfiguration propertyConfig = new PropertyConfiguration((InputStream) null);
        TwitterImpl twitterImpl = new TwitterImpl(propertyConfig, basicAuth);
        
        // When: The getUserListMemberships method is called with a valid user ID and list ID
        try {
        twitterImpl.getUserListMemberships(1L, 1704, 2562L, false);
        fail("Expected exception not thrown");
        } catch (Exception e) {
        // Then: An exception should be thrown indicating that the API could not be found
        assertTrue(e instanceof TwitterException);
        verifyException("twitter4j.HttpClientImpl", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBlocksIDsThrowsIllegalStateException() throws Throwable  {
        // Given: A Twitter instance with missing authentication credentials
        PropertyConfiguration propertyConfiguration = new PropertyConfiguration((InputStream) null);
        TwitterImpl twitterImpl = new TwitterImpl(propertyConfiguration, (Authorization) null);
        
        // When: Trying to get the blocks IDs of a user with an invalid ID
        long invalidUserId = -1722L;
        try {
        twitterImpl.getBlocksIDs(invalidUserId);
        fail("Expecting exception: IllegalStateException");
        } catch (IllegalStateException e) {
        // Then: The method should throw an IllegalStateException with the correct message and error code
        assertEquals("Authentication credentials are missing. See http://twitter4j.org/en/configuration.html for details. See and register at http://apps.twitter.com/", e.getMessage());
        verifyException("twitter4j.TwitterBaseImpl", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDestroyUserListSubscriptionThrowsException() throws Throwable  {
        // Given a TwitterImpl instance, an InputStream for the property configuration, and a BasicAuthorization object for authentication
        PropertyConfiguration config = new PropertyConfiguration((InputStream) null);
        BasicAuthorization auth = new BasicAuthorization("EEE MMM dd HH:mm:ss z yyyy", "EEE MMM dd HH:mm:ss z yyyy");
        TwitterImpl twitterImpl = new TwitterImpl(config, auth);
        
        // When we attempt to destroy a user list subscription using an invalid screen name and id
        try {
        twitterImpl.destroyUserListSubscription("invalid_screen_name", "4#H-~kG+'D<s");
        fail("Expecting exception: Exception");
        } catch(Exception e) {
        // Verify that the expected exception is thrown, as it is not supported by the protocol
        verifyException("twitter4j.HttpClientImpl", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testUpdateProfileThrowsIllegalStateException() throws Throwable  {
        // Given: The TwitterImpl class is initialized with a null input stream and null authorization
        PropertyConfiguration arg0 = new PropertyConfiguration((InputStream) null);
        TwitterImpl twitterImpl = new TwitterImpl(arg0, (Authorization) null);
        
        // When: The updateProfile method is called with invalid profile information
        try {
        twitterImpl.updateProfile("nf 3SO',1g%;kK_/d.", "nf 3SO',1g%;kK_/d.", (String) null, (String) null);
        fail("Expecting exception: IllegalStateException");
        } catch(IllegalStateException e) {
        
        // Then: An exception is thrown indicating that authentication credentials are missing.
        verifyException("twitter4j.TwitterBaseImpl", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetContributorsThrowsIllegalStateException() throws Throwable  {
        // Arrange
        PropertyConfiguration config = new PropertyConfiguration((InputStream) null);
        OAuth2Authorization auth = new OAuth2Authorization(config);
        TwitterImpl twitterImpl = new TwitterImpl(config, auth);
        
        // Act & Assert
        try {
        twitterImpl.getContributors(-565L);
        } catch (IllegalStateException e) {
        assertEquals("Authentication credentials are missing. See http://twitter4j.org/en/configuration.html for details. See and register at http://apps.twitter.com/",
        e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFriendsListThrowsIllegalStateException() throws Throwable  {
        // Given
        PropertyConfiguration configuration = new PropertyConfiguration((InputStream) null);
        OAuthAuthorization auth = new OAuthAuthorization(configuration);
        TwitterImpl twitter = new TwitterImpl(configuration, auth);
        
        // When
        try {
        twitter.getFriendsList("BgAZLE<h", 858L, 1, false, true);
        fail();
        } catch (IllegalStateException e) {
        // Then
        assertEquals("Authentication credentials are missing. See http://twitter4j.org/en/configuration.html for details. See and register at http://apps.twitter.com/", e.getMessage());}
    }
  }
  