feat: broken sql tests

This commit is contained in:
aro 2023-01-23 18:12:23 +01:00
parent 974a6facc3
commit 7484b40cfc
3 changed files with 4 additions and 5 deletions

View file

@ -19,9 +19,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>

View file

@ -34,6 +34,8 @@ public class SQLStorage extends Storage {
@Override
public ActionResult<Void> store(UUID uuid, NickoProfile profile) {
final Connection connection = getProvider().getConnection();
if (connection == null) return new ActionResult<>(I18NDict.Error.SQL_ERROR);
try {
final String sql = """
INSERT IGNORE INTO nicko.DATA

View file

@ -34,12 +34,12 @@ public class BrokenSQLTest {
}
@Test
@DisplayName("Store Player Via SQL")
@DisplayName("Fail to Store Player Via SQL")
public void storePlayer() {
final PlayerMock playerMock = server.addPlayer();
final NickoProfile profile = new NickoProfile("Notch", "Notch", Locale.ENGLISH, true);
final ActionResult<Void> storeAction = plugin.getDataStore().getStorage().store(playerMock.getUniqueId(), profile);
Assertions.assertFalse(storeAction.isError());
Assertions.assertTrue(storeAction.isError());
}
@AfterAll