diff --git a/Jenkinsfile b/Jenkinsfile index 9dbf205..bb7aebd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('Gradle') { steps { - sh 'bash gradlew build' + sh 'bash gradlew build -DdontRunDatabaseTests=true' } } stage('Archive') { diff --git a/src/test/java/TestForm.java b/src/test/java/TestForm.java index 97553a6..8cc6be7 100644 --- a/src/test/java/TestForm.java +++ b/src/test/java/TestForm.java @@ -5,16 +5,21 @@ import com.alttd.forms.form.Form; import com.alttd.forms.verify_mail.FormQuery; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.Optional; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + public class TestForm { private static int code; @BeforeAll + @Disabled public static void testInsert() { + assumeTrue(System.getProperty("doNotRunDatabaseTests") == null); Assertions.assertDoesNotThrow(() -> DatabaseConnection.initialize()); StoreFormQuery storeFormQuery = new StoreFormQuery(); ContactFormData contactFormData = new ContactFormData("akastijn", "akastijn@alttd.com", "This is a test question."); @@ -27,7 +32,9 @@ public class TestForm { } @Test + @Disabled public void testRetrieveForm() { + assumeTrue(System.getProperty("doNotRunDatabaseTests") == null); Assertions.assertDoesNotThrow(() -> DatabaseConnection.initialize()); new FormQuery().getFormForCode(String.valueOf(code), "akastijn@alttd.com").thenAccept(result -> { Assertions.assertTrue(result.failReason().isEmpty());