Merge remote-tracking branch 'origin/main'

This commit is contained in:
yabinmeng
2024-05-10 15:51:17 -05:00
41 changed files with 2314 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 nosqlbench
* Copyright (c) 2020-2024 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -302,6 +302,7 @@ public class ParsedTemplateMap implements LongFunction<Map<String, ?>>, StaticFi
} else if (isConfig(field)) {
return getConfig(field);
}
logger.warn("static field '{}' was requested, but it does not exist", field);
return null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 nosqlbench
* Copyright (c) 2020-2024 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,4 +58,10 @@ public class ParsedTemplateMapTest {
}
@Test
public void testForNullWhenNoFieldFoundWhenCallingStaticValue() {
ParsedTemplateMap ptm = new ParsedTemplateMap("name1", Map.of("string1", "string2"), Map.of(), List.of());
assertThat(ptm.getStaticValue("notfound", String.class)).isNull();
}
}