Skip to content

Commit

Permalink
Merge c0aef6f into f129569
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst committed Nov 20, 2020
2 parents f129569 + c0aef6f commit a921d30
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
Expand Up @@ -2,6 +2,7 @@

import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasProperty;
Expand All @@ -10,7 +11,6 @@
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
Expand Down
@@ -1,7 +1,7 @@
package com.github.valfirst.jbehave.junit.monitoring;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.verify;

import java.util.Arrays;
Expand Down
@@ -1,23 +1,18 @@
package com.github.valfirst.jbehave.junit.monitoring;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.jbehave.core.embedder.Embedder;
import org.jbehave.core.embedder.EmbedderControls;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;

public class JUnitReportingRunnerTest {

@Rule
public final ExpectedException expectedException = ExpectedException.none();

@Test
public void shouldPrepareEmbedder() {
EmbedderControls ec = mock(EmbedderControls.class);
Expand Down
@@ -1,10 +1,10 @@
package com.github.valfirst.jbehave.junit.monitoring;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

import java.util.Collections;

Expand Down Expand Up @@ -303,7 +303,7 @@ public void shouldNotNotifySubStepWithoutBeforeAction() {
reporter = new JUnitScenarioReporter(notifier, 1, rootDescription, keywords);

reportStepSuccess(reporter);
verifyZeroInteractions(notifier);
verifyNoInteractions(notifier);
}

@Test
Expand Down
@@ -1,7 +1,7 @@
package com.github.valfirst.jbehave.junit.monitoring;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -16,17 +16,12 @@
import org.jbehave.core.io.StoryPathResolver;
import org.jbehave.core.junit.JUnitStories;
import org.jbehave.core.junit.JUnitStory;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class StoryPathsExtractorTest {

private static final List<String> JUNIT_STORIES_PATHS = Arrays.asList("/path/story1.story", "/path/story2.story");

@Rule
public final ExpectedException expectedException = ExpectedException.none();

@Test
public void shouldExtractStoryPathsFromJUnitStory() throws ReflectiveOperationException {
TestJUnitStory testJUnitStory = new TestJUnitStory();
Expand All @@ -52,11 +47,11 @@ public void shouldExtractStoryPathsFromJUnitStoriesChild() throws ReflectiveOper
}

@Test
public void shouldThrowExceptionWhenTypeOfConfigurableEmbedderIsUnknown() throws ReflectiveOperationException {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage(
equalTo("Only ConfigurableEmbedder of types JUnitStory and JUnitStories is supported"));
new StoryPathsExtractor(new TestConfigurableEmbedder()).getStoryPaths();
public void shouldThrowExceptionWhenTypeOfConfigurableEmbedderIsUnknown() {
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
() -> new StoryPathsExtractor(new TestConfigurableEmbedder()).getStoryPaths());
assertEquals("Only ConfigurableEmbedder of types JUnitStory and JUnitStories is supported",
exception.getMessage());
}

public static class TestJUnitStory extends JUnitStory {
Expand Down

0 comments on commit a921d30

Please sign in to comment.