mirror of https://github.com/apache/druid.git
* Enabling Static Imports for Unit Testing DSLs (#331) Co-authored-by: mohammadshoaib <mohammadshoaib@miqdigital.com> * Feature 8885 - Enabling Static Imports for Unit Testing DSLs (#435) * Enabling Static Imports for Unit Testing DSLs * Using suppressions checkstyle to allow static imports only in the UTs Co-authored-by: mohammadshoaib <mohammadshoaib@miqdigital.com> * Removing the changes in the checkstyle because those are not needed Co-authored-by: mohammadshoaib <mohammadshoaib@miqdigital.com>
This commit is contained in:
parent
c01fd56182
commit
84290a2332
|
@ -69,4 +69,5 @@
|
|||
|
||||
<suppress checks="ImportOrder" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||
<suppress checks="EmptyLineSeparator" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||
<suppress checks="AvoidStaticImport" files="[\\/]src[\\/](test)[\\/]"/>
|
||||
</suppressions>
|
||||
|
|
|
@ -23,6 +23,9 @@ import org.junit.Assert;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.apache.druid.common.config.NullHandling.replaceWithDefault;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class NullHandlingTest
|
||||
{
|
||||
@BeforeClass
|
||||
|
@ -34,8 +37,8 @@ public class NullHandlingTest
|
|||
@Test
|
||||
public void test_defaultValueForClass_float()
|
||||
{
|
||||
Assert.assertEquals(
|
||||
NullHandling.replaceWithDefault() ? 0f : null,
|
||||
assertEquals(
|
||||
replaceWithDefault() ? 0f : null,
|
||||
NullHandling.defaultValueForClass(Float.class)
|
||||
);
|
||||
}
|
||||
|
@ -43,8 +46,8 @@ public class NullHandlingTest
|
|||
@Test
|
||||
public void test_defaultValueForClass_double()
|
||||
{
|
||||
Assert.assertEquals(
|
||||
NullHandling.replaceWithDefault() ? 0d : null,
|
||||
assertEquals(
|
||||
replaceWithDefault() ? 0d : null,
|
||||
NullHandling.defaultValueForClass(Double.class)
|
||||
);
|
||||
}
|
||||
|
@ -58,8 +61,8 @@ public class NullHandlingTest
|
|||
@Test
|
||||
public void test_defaultValueForClass_long()
|
||||
{
|
||||
Assert.assertEquals(
|
||||
NullHandling.replaceWithDefault() ? 0L : null,
|
||||
assertEquals(
|
||||
replaceWithDefault() ? 0L : null,
|
||||
NullHandling.defaultValueForClass(Long.class)
|
||||
);
|
||||
}
|
||||
|
@ -67,8 +70,8 @@ public class NullHandlingTest
|
|||
@Test
|
||||
public void test_defaultValueForClass_number()
|
||||
{
|
||||
Assert.assertEquals(
|
||||
NullHandling.replaceWithDefault() ? 0d : null,
|
||||
assertEquals(
|
||||
replaceWithDefault() ? 0d : null,
|
||||
NullHandling.defaultValueForClass(Number.class)
|
||||
);
|
||||
}
|
||||
|
@ -76,8 +79,8 @@ public class NullHandlingTest
|
|||
@Test
|
||||
public void test_defaultValueForClass_string()
|
||||
{
|
||||
Assert.assertEquals(
|
||||
NullHandling.replaceWithDefault() ? "" : null,
|
||||
assertEquals(
|
||||
replaceWithDefault() ? "" : null,
|
||||
NullHandling.defaultValueForClass(String.class)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue