mirror of https://github.com/rusefi/rusefi.git
only: reducing junit4
This commit is contained in:
parent
9926fe41f2
commit
b7df0ed4cb
|
@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static com.rusefi.AssertCompatibility.assertEquals;
|
||||||
|
|
||||||
public class LiveDataProcessorTest {
|
public class LiveDataProcessorTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static com.rusefi.AssertCompatibility.assertEquals;
|
||||||
|
|
||||||
public class StateDictionaryGeneratorTest {
|
public class StateDictionaryGeneratorTest {
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi;
|
||||||
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.function.Executable;
|
||||||
|
|
||||||
public class AssertCompatibility {
|
public class AssertCompatibility {
|
||||||
// FACEPALM: between junit4 and junit4 they have changed order of arguments
|
// FACEPALM: between junit4 and junit4 they have changed order of arguments
|
||||||
|
@ -9,7 +10,31 @@ public class AssertCompatibility {
|
||||||
Assertions.assertNotNull(actual, message);
|
Assertions.assertNotNull(actual, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void assertNotNull(Object actual) {
|
||||||
|
Assertions.assertNotNull(actual);
|
||||||
|
}
|
||||||
|
|
||||||
public static void assertEquals(Object expected, Object actual) {
|
public static void assertEquals(Object expected, Object actual) {
|
||||||
Assertions.assertEquals(expected, actual);
|
Assertions.assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void assertEquals(String message, int expected, int actual) {
|
||||||
|
Assertions.assertEquals(expected, actual, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void assertTrue(boolean condition) {
|
||||||
|
Assertions.assertTrue(condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void assertFalse(boolean condition) {
|
||||||
|
Assertions.assertFalse(condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable, Executable executable) {
|
||||||
|
return Assertions.assertThrows(expectedThrowable, executable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void assertTrue(String message, boolean condition) {
|
||||||
|
Assertions.assertTrue(condition, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue