Skip to content

Commit

Permalink
protect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbros committed Nov 27, 2023
1 parent 6d2c936 commit 618bffd
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions shotover-proxy/tests/cassandra_int_tests/protect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,49 @@ pub async fn test(shotover_session: &CassandraConnection, direct_session: &Cassa
)
.await;

assert_query_result(
shotover_session,
"SELECT pk, cluster, col1, col2, col3 FROM test_protect_keyspace.test_table",
&[
&[
ResultValue::Varchar("pk1".into()),
ResultValue::Varchar("cluster".into()),
ResultValue::Blob("I am gonna get encrypted!!".into()),
ResultValue::Int(0),
ResultValue::Boolean(true),
],
&[
ResultValue::Varchar("pk2".into()),
ResultValue::Varchar("cluster".into()),
ResultValue::Blob("encrypted2".into()),
ResultValue::Int(1),
ResultValue::Boolean(true),
],
&[
ResultValue::Varchar("pk3".into()),
ResultValue::Varchar("cluster".into()),
ResultValue::Blob("encrypted3".into()),
ResultValue::Int(2),
ResultValue::Boolean(false),
],
&[
ResultValue::Varchar("pk4".into()),
ResultValue::Varchar("cluster".into()),
ResultValue::Blob("encrypted4".into()),
ResultValue::Int(3),
ResultValue::Boolean(true),
],
&[
ResultValue::Varchar("pk5".into()),
ResultValue::Varchar("cluster".into()),
ResultValue::Blob("encrypted5".into()),
ResultValue::Int(4),
ResultValue::Boolean(false),
],
],
)
.await;

// assert that data is encrypted on cassandra side
let result = direct_session
.execute("SELECT pk, cluster, col1, col2, col3 FROM test_protect_keyspace.test_table")
Expand Down

0 comments on commit 618bffd

Please sign in to comment.