Class AbstractCosmosDbJunit<T extends AbstractCosmosDbJunit<T>>

  • Direct Known Subclasses:
    CosmosDbExtension, CosmosDbRule

    public abstract class AbstractCosmosDbJunit<T extends AbstractCosmosDbJunit<T>>
    extends java.lang.Object
    Abstract JUnit CosmosDb functionality.
    Author:
    Daniel Sagenschneider
    • Field Detail

      • DEFAULT_LOCAL_COSMOS_PORT

        public static final int DEFAULT_LOCAL_COSMOS_PORT
        Default local CosmosDb port.
        See Also:
        Constant Field Values
      • cosmosClient

        protected com.azure.cosmos.CosmosClient cosmosClient
        CosmosClient.
      • cosmosAsyncClient

        protected com.azure.cosmos.CosmosAsyncClient cosmosAsyncClient
        CosmosAsyncClient.
      • isWaitForCosmosDb

        protected boolean isWaitForCosmosDb
        Flags to wait for CosmosDb to be available on start.
    • Method Detail

      • waitForCosmosDb

        public T waitForCosmosDb()
        Sets up to wait on CosmosDB to be available.
        Returns:
        this.
      • getEndpointUrl

        public java.lang.String getEndpointUrl()
        Obtains the end point URL.
        Returns:
        End point URL.
      • getCosmosClient

        public com.azure.cosmos.CosmosClient getCosmosClient()
        Obtains the CosmosClient.
        Returns:
        CosmosClient.
      • getCosmosAsyncClient

        public com.azure.cosmos.CosmosAsyncClient getCosmosAsyncClient()
        Obtains the CosmosAsyncClient.
        Returns:
        CosmosAsyncClient.
      • startCosmosDb

        protected void startCosmosDb()
                              throws java.lang.Exception
        Start CosmosDb locally.
        Throws:
        java.lang.Exception - If fails to start.
      • stopCosmosDb

        protected void stopCosmosDb()
                             throws java.lang.Exception
        Stops locally running CosmosDb.
        Throws:
        java.lang.Exception - If fails to stop.