Fixed most reported issues by SonarCloud.

This commit is contained in:
Toxic Dreamz
2020-08-15 21:47:39 +04:00
parent e7e3ace01f
commit 31471acb69
190 changed files with 1426 additions and 661 deletions

View File

@ -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[]{}));
}
}

View File

@ -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.
*/
}