use of com.scalar.db.api.Operation in project scalardb by scalar-labs.
the class DeleteStatementHandlerTest method checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException.
/**
* Unit testing for handle() method is covered in InsertStatementHandlerTest
*/
@Test
public void checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException() {
// Arrange
Operation operation = mock(Put.class);
// Act Assert
assertThatThrownBy(() -> StatementHandler.checkArgument(operation, Delete.class)).isInstanceOf(IllegalArgumentException.class);
}
use of com.scalar.db.api.Operation in project scalardb by scalar-labs.
the class InsertStatementHandlerTest method checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException.
@Test
public void checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException() {
// Arrange
Operation operation = mock(Get.class);
// Act Assert
assertThatThrownBy(() -> StatementHandler.checkArgument(operation, Put.class)).isInstanceOf(IllegalArgumentException.class);
}
use of com.scalar.db.api.Operation in project scalardb by scalar-labs.
the class SelectStatementHandlerTest method checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException.
@Test
public void checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException() {
// Arrange
Operation operation = mock(Put.class);
// Act Assert
assertThatThrownBy(() -> StatementHandler.checkArgument(operation, Get.class, Scan.class)).isInstanceOf(IllegalArgumentException.class);
}
use of com.scalar.db.api.Operation in project scalardb by scalar-labs.
the class CosmosOperationTest method checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException.
@Test
public void checkArgument_WrongOperationGiven_ShouldThrowIllegalArgumentException() {
// Arrange
Operation operation = mock(Put.class);
CosmosOperation cosmosOperation = new CosmosOperation(operation, metadata);
// Act Assert
assertThatThrownBy(() -> cosmosOperation.checkArgument(Get.class)).isInstanceOf(IllegalArgumentException.class);
}