Skip to content

Commit f29e8f3

Browse files
committed
update tests
1 parent c485371 commit f29e8f3

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

faunadb-java/src/main/java/com/faunadb/client/types/MetricsResponse.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ public enum Metrics {
5151
QUERY_BYTES_IN("x-query-bytes-in"),
5252
QUERY_BYTES_OUT("x-query-bytes-out"),
5353
QUERY_TIME("x-query-time"),
54-
READ_OPS("x-read-ops"),
5554
STORAGE_BYTES_READ("x-storage-bytes-read"),
5655
STORAGE_BYTES_WRITE("x-storage-bytes-write"),
5756
TXN_RETRIES("x-txn-retries"),
58-
TXN_TIME("x-txn-time"),
59-
WRITE_OPS("x-write-ops");
57+
TXN_TIME("x-txn-time");
6058

6159
private final String metric;
6260

faunadb-java/src/test/java/com/faunadb/client/ClientSpec.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,10 @@ public void shouldReturnMetricsData() throws Exception {
325325
Optional<String> queryBytesIn = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_IN);
326326
Optional<String> queryBytesOut = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_OUT);
327327
Optional<String> queryTime = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_TIME);
328-
Optional<String> readOps = metricsResponse.getMetric(MetricsResponse.Metrics.READ_OPS);
329328
Optional<String> storageBytesRead = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_READ);
330329
Optional<String> storageBytesWrite = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_WRITE);
331330
Optional<String> txnRetries = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_RETRIES);
332331
Optional<String> txnTime = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_TIME);
333-
Optional<String> writeOps = metricsResponse.getMetric(MetricsResponse.Metrics.WRITE_OPS);
334332

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

31763174
adminClient.stream(CreateCollection(Collection("spells"))).get();
31773175
}

faunadb-scala/src/test/scala/faunadb/ClientSpec.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@ class ClientSpec
21632163
it should "stream return error if the query is not readonly" in {
21642164
val err = client.stream(Create(Collection("spells"), Obj("data" -> Obj("testField" -> "testValue0")))).failed.futureValue
21652165
err shouldBe a[BadRequestException]
2166-
err.getMessage should include("Write effect in read-only query expression.")
2166+
err.getMessage should include("Call performs a write, which is not allowed in stream requests.")
21672167
}
21682168

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

0 commit comments

Comments
 (0)