mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix testing for optional op data
This commit is contained in:
parent
56e67a959a
commit
c31302e4d0
@ -5,7 +5,6 @@ import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
|
|||||||
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.net.http.HttpRequest;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
@ -97,7 +96,7 @@ public class ReadyHttpOpTest {
|
|||||||
" body: StaticString('test')\n");
|
" body: StaticString('test')\n");
|
||||||
OpTemplate stmtDef = docs.getStmts().get(0);
|
OpTemplate stmtDef = docs.getStmts().get(0);
|
||||||
|
|
||||||
Map<String, String> parse = HttpFormatParser.parseInline(stmtDef.getStmt());
|
Map<String, String> parse = HttpFormatParser.parseInline(stmtDef.getStmt().orElseThrow());
|
||||||
assertThat(parse).containsAllEntriesOf(
|
assertThat(parse).containsAllEntriesOf(
|
||||||
Map.of(
|
Map.of(
|
||||||
"method", "{method}",
|
"method", "{method}",
|
||||||
@ -110,4 +109,4 @@ public class ReadyHttpOpTest {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class OpDefTest {
|
|||||||
assertThat(ops).hasSize(2);
|
assertThat(ops).hasSize(2);
|
||||||
OpTemplate sdef1 = ops.get(0);
|
OpTemplate sdef1 = ops.get(0);
|
||||||
assertThat(sdef1.getName()).isEqualTo("doc1--block0--stmt1");
|
assertThat(sdef1.getName()).isEqualTo("doc1--block0--stmt1");
|
||||||
assertThat(ops.get(0).getOp()).isEqualTo(Map.of("stmt","s1"));
|
assertThat(ops.get(0).getOp()).contains(Map.of("stmt","s1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -110,7 +110,7 @@ public class OpDefTest {
|
|||||||
OpTemplate op1 = block1.getOps().get(1);
|
OpTemplate op1 = block1.getOps().get(1);
|
||||||
assertThat(op1.getParams()).containsAllEntriesOf(Map.of());
|
assertThat(op1.getParams()).containsAllEntriesOf(Map.of());
|
||||||
assertThat(op1.getName()).isEqualTo("map-of-maps--block0--s2");
|
assertThat(op1.getName()).isEqualTo("map-of-maps--block0--s2");
|
||||||
assertThat(op1.getOp()).isEqualTo(Map.of("stmt","statement2"));
|
assertThat(op1.getOp()).contains(Map.of("stmt","statement2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -125,7 +125,7 @@ public class OpDefTest {
|
|||||||
assertThat(block1.getOps()).hasSize(1);
|
assertThat(block1.getOps()).hasSize(1);
|
||||||
OpTemplate op0 = block1.getOps().get(0);
|
OpTemplate op0 = block1.getOps().get(0);
|
||||||
assertThat(op0.getName()).isEqualTo("string-statement--block0--stmt1");
|
assertThat(op0.getName()).isEqualTo("string-statement--block0--stmt1");
|
||||||
assertThat(op0.getOp()).isEqualTo(Map.of("stmt","test statement"));
|
assertThat(op0.getOp()).contains(Map.of("stmt","test statement"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user