{Immutable}NodeItemTest: categorise findInPath tests

This commit is contained in:
Paul Campbell 2016-09-04 19:21:18 +01:00
parent 02d07605c0
commit 6987f927fe
2 changed files with 14 additions and 4 deletions

View file

@ -4,14 +4,15 @@ import lombok.val;
import org.assertj.core.api.SoftAssertions; import org.assertj.core.api.SoftAssertions;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Optional; import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Test for {@link ImmutableNodeItem}. * Test for {@link ImmutableNodeItem}.
* *
@ -141,6 +142,7 @@ public class ImmutableNodeItemTest {
* Test that we can walk a tree to the target node. * Test that we can walk a tree to the target node.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldWalkTreeToNode() { public void shouldWalkTreeToNode() {
//given //given
val root = Nodes.unnamedRoot("root"); val root = Nodes.unnamedRoot("root");
@ -160,6 +162,7 @@ public class ImmutableNodeItemTest {
* doesn't exist. * doesn't exist.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldNotFindNonExistentChildNode() { public void shouldNotFindNonExistentChildNode() {
//given //given
val root = Nodes.unnamedRoot("root"); val root = Nodes.unnamedRoot("root");
@ -176,6 +179,7 @@ public class ImmutableNodeItemTest {
* Test that when we pass null we get an exception. * Test that when we pass null we get an exception.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldThrowNEWhenWalkTreeNull() { public void shouldThrowNEWhenWalkTreeNull() {
//given //given
immutableNode = Nodes.asImmutable(Nodes.unnamedRoot("subject")); immutableNode = Nodes.asImmutable(Nodes.unnamedRoot("subject"));
@ -190,6 +194,7 @@ public class ImmutableNodeItemTest {
* a result. * a result.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldReturnEmptyForEmptyWalkTreePath() { public void shouldReturnEmptyForEmptyWalkTreePath() {
//given //given
immutableNode = Nodes.asImmutable(Nodes.unnamedRoot("subject")); immutableNode = Nodes.asImmutable(Nodes.unnamedRoot("subject"));

View file

@ -4,14 +4,15 @@ import lombok.val;
import org.assertj.core.api.SoftAssertions; import org.assertj.core.api.SoftAssertions;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Optional; import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Test for {@link NodeItem}. * Test for {@link NodeItem}.
* *
@ -309,6 +310,7 @@ public class NodeItemTest {
* Test that we can walk a tree to the target node. * Test that we can walk a tree to the target node.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldWalkTreeToNode() { public void shouldWalkTreeToNode() {
//given //given
val grandparent = "grandparent"; val grandparent = "grandparent";
@ -334,6 +336,7 @@ public class NodeItemTest {
* doesn't exist. * doesn't exist.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldNotFindNonExistentChildNode() { public void shouldNotFindNonExistentChildNode() {
//given //given
val parent = "parent"; val parent = "parent";
@ -352,6 +355,7 @@ public class NodeItemTest {
* Test that when we pass null we get an exception. * Test that when we pass null we get an exception.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldThrowNEWhenWalkTreeNull() { public void shouldThrowNEWhenWalkTreeNull() {
//given //given
node = Nodes.unnamedRoot("subject"); node = Nodes.unnamedRoot("subject");
@ -366,6 +370,7 @@ public class NodeItemTest {
* a result. * a result.
*/ */
@Test @Test
@Category(NodeFindInPathTestsCategory.class)
public void shouldReturnEmptyForEmptyWalkTreePath() { public void shouldReturnEmptyForEmptyWalkTreePath() {
//given //given
node = Nodes.unnamedRoot("subject"); node = Nodes.unnamedRoot("subject");