use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.
the class MultiCassandraSingleNodeDownEteTest method shouldBeAbleToReadWithOneCassandraNodeDown.
@Test
public void shouldBeAbleToReadWithOneCassandraNodeDown() {
TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
Todo todo = getUniqueTodo();
todos.addTodo(todo);
assertThat(todos.getTodoList()).contains(todo);
}
use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.
the class MultiCassandraSingleNodeDownEteTest method shouldBeAbleToWriteWithOneCassandraNodeDown.
@Test
public void shouldBeAbleToWriteWithOneCassandraNodeDown() {
TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
Todo todo = getUniqueTodo();
todos.addTodo(todo);
}
use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.
the class MultiCassandraDoubleNodeDownEteTest method shouldNotBeAbleToReadWithTwoCassandraNodesDown.
@Test(expected = RuntimeException.class)
public void shouldNotBeAbleToReadWithTwoCassandraNodesDown() {
TodoResource todos = EteSetup.createClientToSingleNode(TodoResource.class);
todos.getTodoList();
}
use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.
the class TimeLockMigrationEteTest method assertCanNeitherReadNorWrite.
private void assertCanNeitherReadNorWrite() {
TodoResource todoClient = createEteClientFor(TodoResource.class);
softAssertions.assertThat(catchThrowable(() -> todoClient.addTodo(TODO_3))).as("cannot write using embedded service after migration to TimeLock").hasMessageContaining("Connection refused");
softAssertions.assertThat(catchThrowable(todoClient::getTodoList)).as("cannot read using embedded service after migration to TimeLock").hasMessageContaining("Connection refused");
}
use of com.palantir.atlasdb.todo.TodoResource in project atlasdb by palantir.
the class TimeLockMigrationEteTest method automaticallyMigratesTimestampsAndFailsOnRestart.
@Test
public void automaticallyMigratesTimestampsAndFailsOnRestart() throws Exception {
TimestampService timestampClient = createEteClientFor(TimestampService.class);
TodoResource todoClient = createEteClientFor(TodoResource.class);
todoClient.addTodo(TODO);
softAssertions.assertThat(todoClient.getTodoList()).as("contains one todo pre-migration").contains(TODO);
long embeddedTimestamp = timestampClient.getFreshTimestamp();
softAssertions.assertThat(embeddedTimestamp).as("can get a timestamp before migration").isNotNull();
upgradeAtlasClientToTimelock();
assertTimeLockGivesHigherTimestampThan(embeddedTimestamp);
softAssertions.assertThat(todoClient.getTodoList()).as("can still read todo after migration to TimeLock").contains(TODO);
todoClient.addTodo(TODO_2);
softAssertions.assertThat(todoClient.getTodoList()).as("can add a new todo using TimeLock").contains(TODO, TODO_2);
assertNoLongerExposesEmbeddedTimestampService();
downgradeAtlasClientFromTimelockWithoutMigration();
assertCanNeitherReadNorWrite();
}
Aggregations