mirror of
https://github.com/apache/druid.git
synced 2025-02-08 19:14:49 +00:00
* 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="ImportOrder" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||||
<suppress checks="EmptyLineSeparator" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
<suppress checks="EmptyLineSeparator" files="[\\/]target[\\/]generated-test-sources[\\/]" />
|
||||||
|
<suppress checks="AvoidStaticImport" files="[\\/]src[\\/](test)[\\/]"/>
|
||||||
</suppressions>
|
</suppressions>
|
||||||
|
@ -23,6 +23,9 @@ import org.junit.Assert;
|
|||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.apache.druid.common.config.NullHandling.replaceWithDefault;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
public class NullHandlingTest
|
public class NullHandlingTest
|
||||||
{
|
{
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
@ -34,8 +37,8 @@ public class NullHandlingTest
|
|||||||
@Test
|
@Test
|
||||||
public void test_defaultValueForClass_float()
|
public void test_defaultValueForClass_float()
|
||||||
{
|
{
|
||||||
Assert.assertEquals(
|
assertEquals(
|
||||||
NullHandling.replaceWithDefault() ? 0f : null,
|
replaceWithDefault() ? 0f : null,
|
||||||
NullHandling.defaultValueForClass(Float.class)
|
NullHandling.defaultValueForClass(Float.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -43,8 +46,8 @@ public class NullHandlingTest
|
|||||||
@Test
|
@Test
|
||||||
public void test_defaultValueForClass_double()
|
public void test_defaultValueForClass_double()
|
||||||
{
|
{
|
||||||
Assert.assertEquals(
|
assertEquals(
|
||||||
NullHandling.replaceWithDefault() ? 0d : null,
|
replaceWithDefault() ? 0d : null,
|
||||||
NullHandling.defaultValueForClass(Double.class)
|
NullHandling.defaultValueForClass(Double.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -58,8 +61,8 @@ public class NullHandlingTest
|
|||||||
@Test
|
@Test
|
||||||
public void test_defaultValueForClass_long()
|
public void test_defaultValueForClass_long()
|
||||||
{
|
{
|
||||||
Assert.assertEquals(
|
assertEquals(
|
||||||
NullHandling.replaceWithDefault() ? 0L : null,
|
replaceWithDefault() ? 0L : null,
|
||||||
NullHandling.defaultValueForClass(Long.class)
|
NullHandling.defaultValueForClass(Long.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -67,8 +70,8 @@ public class NullHandlingTest
|
|||||||
@Test
|
@Test
|
||||||
public void test_defaultValueForClass_number()
|
public void test_defaultValueForClass_number()
|
||||||
{
|
{
|
||||||
Assert.assertEquals(
|
assertEquals(
|
||||||
NullHandling.replaceWithDefault() ? 0d : null,
|
replaceWithDefault() ? 0d : null,
|
||||||
NullHandling.defaultValueForClass(Number.class)
|
NullHandling.defaultValueForClass(Number.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -76,8 +79,8 @@ public class NullHandlingTest
|
|||||||
@Test
|
@Test
|
||||||
public void test_defaultValueForClass_string()
|
public void test_defaultValueForClass_string()
|
||||||
{
|
{
|
||||||
Assert.assertEquals(
|
assertEquals(
|
||||||
NullHandling.replaceWithDefault() ? "" : null,
|
replaceWithDefault() ? "" : null,
|
||||||
NullHandling.defaultValueForClass(String.class)
|
NullHandling.defaultValueForClass(String.class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user