Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpaterson committed Oct 14, 2024
1 parent c485371 commit f29e8f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ public enum Metrics {
QUERY_BYTES_IN("x-query-bytes-in"),
QUERY_BYTES_OUT("x-query-bytes-out"),
QUERY_TIME("x-query-time"),
READ_OPS("x-read-ops"),
STORAGE_BYTES_READ("x-storage-bytes-read"),
STORAGE_BYTES_WRITE("x-storage-bytes-write"),
TXN_RETRIES("x-txn-retries"),
TXN_TIME("x-txn-time"),
WRITE_OPS("x-write-ops");
TXN_TIME("x-txn-time");

private final String metric;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,10 @@ public void shouldReturnMetricsData() throws Exception {
Optional<String> queryBytesIn = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_IN);
Optional<String> queryBytesOut = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_OUT);
Optional<String> queryTime = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_TIME);
Optional<String> readOps = metricsResponse.getMetric(MetricsResponse.Metrics.READ_OPS);
Optional<String> storageBytesRead = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_READ);
Optional<String> storageBytesWrite = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_WRITE);
Optional<String> txnRetries = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_RETRIES);
Optional<String> txnTime = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_TIME);
Optional<String> writeOps = metricsResponse.getMetric(MetricsResponse.Metrics.WRITE_OPS);

assertThat(byteReadOps.isPresent(), is(true));
assertThat(byteWriteOps.isPresent(), is(true));
Expand Down Expand Up @@ -3171,7 +3169,7 @@ public void streamFailsIfTargetDoesNotExist() throws Exception {
@Test
public void streamFailsIfQueryIsNotReadOnly() throws Exception {
thrown.expectCause(isA(BadRequestException.class));
thrown.expectMessage(containsString("invalid expression: Write effect in read-only query expression."));
thrown.expectMessage(containsString("invalid expression: Call performs a write, which is not allowed in stream requests."));

adminClient.stream(CreateCollection(Collection("spells"))).get();
}
Expand Down
2 changes: 1 addition & 1 deletion faunadb-scala/src/test/scala/faunadb/ClientSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ class ClientSpec
it should "stream return error if the query is not readonly" in {
val err = client.stream(Create(Collection("spells"), Obj("data" -> Obj("testField" -> "testValue0")))).failed.futureValue
err shouldBe a[BadRequestException]
err.getMessage should include("Write effect in read-only query expression.")
err.getMessage should include("Call performs a write, which is not allowed in stream requests.")
}

it should "stream on document reference contains `document` field by default" in {
Expand Down

0 comments on commit f29e8f3

Please sign in to comment.