فهرست منبع

Remove log tests due to LogCaptor not working anymore

Lortseam 4 سال پیش
والد
کامیت
b215e2f86c

+ 0 - 1
gradle.properties

@@ -17,7 +17,6 @@ cloth_config_version=5.0.34
 configurate_version=4.1.1
 junit_version=5.7.2
 mockito_version=3.10.0
-logcaptor_version=2.5.0
 assertj_version=3.19.0
 jimfs_version=1.2
 modmenu_version=2.0.0-beta.7

+ 0 - 1
lib/build.gradle

@@ -10,7 +10,6 @@ dependencies {
 	testImplementation("org.assertj:assertj-core:${rootProject.assertj_version}")
 	testImplementation("org.mockito:mockito-inline:${rootProject.mockito_version}")
 	testImplementation("org.mockito:mockito-junit-jupiter:${rootProject.mockito_version}")
-	testImplementation("io.github.hakky54:logcaptor:${rootProject.logcaptor_version}")
 	testImplementation("com.google.jimfs:jimfs:${rootProject.jimfs_version}") {
 		exclude group: 'com.google.guava', module: 'guava'
 	}

+ 0 - 16
lib/src/test/java/me/lortseam/completeconfig/data/BaseCollectionTest.java

@@ -4,23 +4,18 @@ import com.google.common.collect.Iterables;
 import me.lortseam.completeconfig.api.ConfigContainer;
 import me.lortseam.completeconfig.exception.IllegalAnnotationTargetException;
 import me.lortseam.completeconfig.test.data.containers.*;
-import me.lortseam.completeconfig.test.data.groups.EmptyGroup;
 import me.lortseam.completeconfig.test.data.listeners.EmptyListener;
 import me.lortseam.completeconfig.test.data.listeners.SetterListener;
 import me.lortseam.completeconfig.text.TranslationKey;
-import nl.altindag.log.LogCaptor;
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.*;
 import static org.mockito.Mockito.mock;
 
 public class BaseCollectionTest {
 
     private BaseCollection baseCollection;
-    private final LogCaptor logCaptor = LogCaptor.forName("CompleteConfig");
 
     @BeforeEach
     public void beforeEach() {
@@ -32,11 +27,6 @@ public class BaseCollectionTest {
         };
     }
 
-    @AfterEach
-    public void afterEach() {
-        logCaptor.clearLogs();
-    }
-
     @Test
     public void resolve_includeFieldIfAnnotated() {
         baseCollection.resolve(new ContainerWithEntry(), new ContainerWithContainerWithEntry(), new ContainerWithGroupWithEntry());
@@ -111,12 +101,6 @@ public class BaseCollectionTest {
         assertEquals("Transitive " + ContainerNestingContainerWithEntry.ContainerWithEntry.class + " must be static", exception.getMessage());
     }
 
-    @Test
-    public void resolve_logWarningIfEmpty() {
-        baseCollection.resolve(new EmptyGroup());
-        assertThat(logCaptor.getWarnLogs()).contains("Empty group: emptyGroup");
-    }
-
     @Test
     public void resolve_listenSetter() {
         SetterListener listener = new SetterListener();

+ 0 - 16
lib/src/test/java/me/lortseam/completeconfig/data/ConfigTest.java

@@ -1,10 +1,7 @@
 package me.lortseam.completeconfig.data;
 
-import nl.altindag.log.LogCaptor;
-import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -12,13 +9,6 @@ public class ConfigTest {
 
     private static final String MOD_ID = "test";
 
-    private final LogCaptor logCaptor = LogCaptor.forName("CompleteConfig");
-
-    @AfterEach
-    public void afterEach() {
-        logCaptor.clearLogs();
-    }
-
     @Test
     public void _throwExceptionIfArgNull() {
         NullPointerException exception = assertThrows(NullPointerException.class, () -> new Config(null));
@@ -28,10 +18,4 @@ public class ConfigTest {
         assertThrows(NullPointerException.class, () -> new Config(MOD_ID, new String[]{null}));
     }
 
-    @Test
-    public void load_logWarningIfEmpty() {
-        new Config(MOD_ID).load();
-        assertThat(logCaptor.getWarnLogs()).contains("Config of ConfigSource(modId=" + MOD_ID + ", branch=[]) is empty");
-    }
-
 }