fix testing for optional op data

This commit is contained in:
Jonathan Shook 2021-06-24 11:18:39 -05:00
parent 56e67a959a
commit c31302e4d0
2 changed files with 5 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import io.nosqlbench.engine.api.activityconfig.yaml.OpTemplate;
import io.nosqlbench.engine.api.activityconfig.yaml.StmtsDocList;
import org.junit.jupiter.api.Test;
import java.net.http.HttpRequest;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
@ -97,7 +96,7 @@ public class ReadyHttpOpTest {
" body: StaticString('test')\n");
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(
Map.of(
"method", "{method}",
@ -110,4 +109,4 @@ public class ReadyHttpOpTest {
}
}
}

View File

@ -75,7 +75,7 @@ public class OpDefTest {
assertThat(ops).hasSize(2);
OpTemplate sdef1 = ops.get(0);
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
@ -110,7 +110,7 @@ public class OpDefTest {
OpTemplate op1 = block1.getOps().get(1);
assertThat(op1.getParams()).containsAllEntriesOf(Map.of());
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
@ -125,7 +125,7 @@ public class OpDefTest {
assertThat(block1.getOps()).hasSize(1);
OpTemplate op0 = block1.getOps().get(0);
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