SessionZooKeeperClient { public void writeStatus(Session.Status sessionStatus) { try { createWriteStatusTransaction(sessionStatus).commit(); } catch (Exception e) { throw new RuntimeException("Unable to write session status", e); } } SessionZooKeeperClient(Curator curator,
                                  ConfigCurator configCurator,
                                  TenantName tenantName,
                                  long sessionId,
                                  String serverId); void writeStatus(Session.Status sessionStatus); Session.Status readStatus(); Curator.CompletionWaiter createActiveWaiter(); CuratorTransaction deleteTransaction(); ApplicationPackage loadApplicationPackage(); ConfigDefinitionRepo getUserConfigDefinitions(); void writeApplicationId(ApplicationId id); Optional<ApplicationId> readApplicationId(); void writeVespaVersion(Version version); Version readVespaVersion(); Optional<DockerImage> readDockerImageRepository(); void writeDockerImageRepository(Optional<DockerImage> dockerImageRepository); Instant readCreateTime(); ZooKeeperDeployer createDeployer(DeployLogger logger); Transaction createWriteStatusTransaction(Session.Status status); void writeAthenzDomain(Optional<AthenzDomain> athenzDomain); Optional<AthenzDomain> readAthenzDomain(); void writeQuota(Optional<Quota> maybeQuota); Optional<Quota> readQuota(); void createNewSession(Instant createTime);  }
@Test public void require_that_status_is_written_to_zk() { int sessionId = 2; SessionZooKeeperClient zkc = createSessionZKClient(sessionId); zkc.writeStatus(Session.Status.NEW); String path = sessionPath(sessionId).append(ConfigCurator.SESSIONSTATE_ZK_SUBPATH).getAbsolute(); assertTrue(configCurator.exists(path)); assertThat(configCurator.getData(path), is("NEW")); }