Fixed most reported issues by SonarCloud.
This commit is contained in:
@ -25,12 +25,15 @@ package com.iluwatar.nullobject;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
|
||||
/**
|
||||
* Application test
|
||||
*/
|
||||
public class AppTest {
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
App.main(new String[]{});
|
||||
void shouldExecuteApplicationWithoutException() {
|
||||
assertDoesNotThrow(() -> App.main(new String[]{}));
|
||||
}
|
||||
}
|
||||
|
@ -35,20 +35,20 @@ import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class NullNodeTest {
|
||||
class NullNodeTest {
|
||||
|
||||
/**
|
||||
* Verify if {@link NullNode#getInstance()} actually returns the same object instance
|
||||
*/
|
||||
@Test
|
||||
public void testGetInstance() {
|
||||
void testGetInstance() {
|
||||
final var instance = NullNode.getInstance();
|
||||
assertNotNull(instance);
|
||||
assertSame(instance, NullNode.getInstance());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFields() {
|
||||
void testFields() {
|
||||
final var node = NullNode.getInstance();
|
||||
assertEquals(0, node.getTreeSize());
|
||||
assertNull(node.getName());
|
||||
@ -56,9 +56,8 @@ public class NullNodeTest {
|
||||
assertNull(node.getRight());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWalk() {
|
||||
NullNode.getInstance().walk();
|
||||
}
|
||||
/**
|
||||
* Removed unnecessary test method for {@link NullNode#walk()} as the method doesn't have an implementation.
|
||||
*/
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user