UnstartedMockNode
Keywords: net.corda.testing.node.UnstartedMockNode class
Date: 2023-09-18

net.corda.testing.node

## Class UnstartedMockNode

- net.corda.testing.node.UnstartedMockNode

-     public class UnstartedMockNode

  A class that represents an unstarted mock node for testing.

- - ### Field Detail

    - #### Companion

          public static net.corda.testing.node.UnstartedMockNode.Companion Companion

  - ### Method Detail

    - #### getId

          public int getId()

      An identifier for the node. By default this is allocated sequentially in a `class MockNetwork`

      See Also:
        `class MockNetwork`

    - #### installCordaService

          @NotNull
          public <T extends SerializeAsToken> T installCordaService(@NotNull
                                                                             java.lang.Class<T> serviceClass)

      Install a custom test-only `annotationclass CordaService`.

      NOTE: There is no need to call this method if the service class is defined in the CorDapp and the `class TestCordapp` API is used.

      Returns:
        the instance of the service object.
      See Also:
        `annotationclass CordaService`, `class TestCordapp`

    - #### start

          @NotNull
          public StartedMockNode start()

      Start the node

      Returns:
        A `class StartedMockNode` object.

    - #### getStarted

          @NotNull
          public StartedMockNode getStarted()

      A `class StartedMockNode` object for this running node.

      Throws:
        `IllegalStateException` - if the node is not running yet.
      See Also:
        `class StartedMockNode`

    - #### isStarted

          public boolean isStarted()

      Whether this node has been started yet.