Merge pull request #8 from msmygit/invalid-driver

Unit test for using non-existent driver
This commit is contained in:
Shubham kumar 2024-04-29 12:13:35 +05:30 committed by GitHub
commit 9a17655ea7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,33 @@
/*
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.nosqlbench.engine.cli;
import io.nosqlbench.nb.api.errors.BasicError;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
public class NBCLITest {
@Test
public void testNonExistentDriverThrowsError() {
assertThatExceptionOfType(BasicError.class)
.isThrownBy(() -> new NBCLI("run driver=nonexistent --show-stacktraces"))
.withMessageContaining("Unable to load default driver adapter 'nonexistent'");
}
}