Class ConnectorTestContext

    • Constructor Detail

      • ConnectorTestContext

        public ConnectorTestContext()
        Creates a new context with the default SimpleAtomConfig and an instance of the connector specified by the implementing class
    • Method Detail

      • getConnectorCache

        public ConcurrentMap<Object,​Object> getConnectorCache()
        Description copied from interface: ConnectorContext
        Returns the current connector cache. This is the preferred means for caching any Connector resources for use across operation calls. This cache is Boomi account specific, so login/credential based information may be put in this cache. Note, however that a given Boomi account may still have multiple connector service accounts, so the cache information should take that into account (e.g. by caching information based on the service username). The lifetime of this cache is defined by the lifetime of the Connector instance (so, essentially indefinite), and, among other things, the objects in this cache must be used in a thread-safe manner.
        Specified by:
        getConnectorCache in interface ConnectorContext
      • getCustomOperationType

        public String getCustomOperationType()
        Description copied from interface: BrowseContext
        Returns the custom type of the operation that is currently being configured. This is the customTypeId field from the connector descriptor.
        Specified by:
        getCustomOperationType in interface BrowseContext
        Returns:
        customTypeId field from the connector descriptor.
      • getConnectionProperties

        public PropertyMap getConnectionProperties()
        Description copied from interface: ConnectorContext
        Returns the relevant connection properties if this connector has the requireConnectionForBrowse flag enabled in the connector's descriptor.
        Specified by:
        getConnectionProperties in interface ConnectorContext
      • getOperationProperties

        public PropertyMap getOperationProperties()
        Description copied from interface: BrowseContext
        Returns any operation properties flagged as includeInBrowse for the current OperationType in the connector's descriptor.
        Specified by:
        getOperationProperties in interface BrowseContext
      • getObjectDefinitionCookie

        public String getObjectDefinitionCookie​(ObjectDefinitionRole role)
        Description copied from interface: OperationContext
        Returns an object definition cookie constructed by the object profile retrieval during a browsing request.
        Specified by:
        getObjectDefinitionCookie in interface OperationContext
        Parameters:
        role - the role identifying the profile for which the profile is desired
        Returns:
        the stored cookie, or null if no cookie was stored for the profile
      • getSelectedFields

        public List<String> getSelectedFields()
        Description copied from interface: OperationContext
        Returns a field list describing the fields to be retrieved. This may be null, indicating that all fields should be retrieved
        Specified by:
        getSelectedFields in interface OperationContext
      • getBrowseContext

        public BrowseContext getBrowseContext()
        Getter for the browse context
        Returns:
        the browseContext
      • setOperationType

        public void setOperationType​(OperationType operationType)
        Setter for the operation type
        Parameters:
        operationType - the operationType to set
      • setOperationCustomType

        public void setOperationCustomType​(String customOperationType)
        Setter for the operation custom type
        Parameters:
        customOperationType - the custom operation id to set
      • setObjectTypeId

        public void setObjectTypeId​(String objectTypeId)
        Getter for the object type id
        Parameters:
        objectTypeId - the objectTypeId to set
      • hasCookie

        public boolean hasCookie​(ObjectDefinitionRole role)
        Method to determine if the context contains a cookie for an ObjectDefinitionRole
        Parameters:
        role - the role to verify
        Returns:
        true if the context contains the role, false otherwise
      • addToCache

        public void addToCache​(Object key,
                               Object value)
        Method to add a key/value pair to the connector cache
        Parameters:
        key - the key for the entry
        value - the value for the entry
      • addConnectionProperty

        public void addConnectionProperty​(String key,
                                          Object value)
        Method to add a connection property to the context
        Parameters:
        key - the key for the property
        value - the value for the property
      • addOperationProperty

        public void addOperationProperty​(String key,
                                         Object value)
        Method to add an operation property to the context
        Parameters:
        key - the key for the property
        value - the value for the property
      • addSelectableField

        public void addSelectableField​(String field)
        Method to add a selectable field to the context
        Parameters:
        field - the name of the field
      • isCookieRequired

        public boolean isCookieRequired()
        This flag indicates whether or not the operation under test requires that a cookie be added to the connector cache
        Returns:
        the cookieRequired
      • setCookieRequired

        public void setCookieRequired​(boolean cookieRequired)
        Setter method for cookie flag
        Parameters:
        cookieRequired - the cookieRequired to set
      • getConnectorClass

        protected abstract Class<? extends Connector> getConnectorClass()
        This method should return the Class of the connector under test
        Returns:
        the connector class