public class TestClient
extends java.lang.Object
implements io.spine.logging.Logging
TestClient
connects to the server using gRPC and allows sending commands and
querying its entities.Constructor and Description |
---|
TestClient(io.spine.core.UserId userId,
java.lang.String host,
int port)
Construct the client connecting to server at
host:port . |
Modifier and Type | Method and Description |
---|---|
boolean |
isShutdown()
Verifies if the client is shutdown.
|
java.util.Optional<io.spine.core.Ack> |
post(io.spine.base.CommandMessage domainCommand)
Creates a command for the passed message and sends it to the server.
|
io.spine.client.QueryResponse |
queryAll(java.lang.Class<? extends io.spine.base.EntityState> messageType)
Queries all entities of provided type.
|
void |
shutdown()
Shutdown the client waiting 5 seconds for preexisting calls to continue.
|
public TestClient(io.spine.core.UserId userId, java.lang.String host, int port)
host:port
.@CanIgnoreReturnValue public java.util.Optional<io.spine.core.Ack> post(io.spine.base.CommandMessage domainCommand)
public io.spine.client.QueryResponse queryAll(java.lang.Class<? extends io.spine.base.EntityState> messageType)
messageType
- an entity type to querypublic void shutdown() throws java.lang.InterruptedException
java.lang.InterruptedException
- if waiting is interrupted.public boolean isShutdown()