// Path: gepard-gherkin-jbehave/src/main/java/com/epam/gepard/gherkin/jbehave/helper/IOUtils.java
// public class IOUtils {
// 
//     /**
//      * Get the contents of an InputStream as a String using the default character encoding of the platform.
//      * This method buffers the input internally, so there is no need to use a BufferedInputStream.
//      * @param inputStream the InputStream to read from
//      * @return the contents of the inputStream
//      * @throws IOException - if an I/O error occurs
//      */
//     public String toString(final InputStream inputStream) throws IOException {
//         return org.apache.commons.io.IOUtils.toString(inputStream);
//     }
// }
// 
// Path: gepard-gherkin-jbehave/src/main/java/com/epam/gepard/gherkin/jbehave/helper/ResourceProvider.java
// public class ResourceProvider {
// 
//     /**
//      * Returns the resource with the given path from the classpath.
//      * @param path the given path of the resource
//      * @return an {@link InputStream} of the resource, or null if not found
//      */
//     public InputStream getResourceAsStream(final String path) {
//         return getClass().getClassLoader().getResourceAsStream(path);
//     }
// 
// }


import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.internal.util.reflection.Whitebox;
import com.epam.gepard.gherkin.jbehave.helper.IOUtils;
import com.epam.gepard.gherkin.jbehave.helper.ResourceProvider;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import org.jbehave.core.model.Story;
import org.junit.Before;
        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase, never()).logComment(Mockito.anyString());
    }

    @Test
    public void testBeforeStoryShouldNotLogBeforeStories() {
        //GIVEN
        Story story = new Story(BEFORE_STORIES_PATH);
        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase, never()).logComment(Mockito.anyString());
    }

    @Test
    public void testBeforeStoryShouldLogStoryAsComment() {
        //GIVEN
        Story story = new Story("path");
        given(resourceProvider.getResourceAsStream("path")).willReturn(inputStream);
        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase).logComment("Using story file: path", "<pre>something</pre>");
    }

    @Test
    public void testBeforeStoryShouldReportWhenStoryDoesNotExist() {
        //GIVEN
// Path: gepard-gherkin-jbehave/src/main/java/com/epam/gepard/gherkin/jbehave/helper/IOUtils.java
// public class IOUtils {
// 
//     /**
//      * Get the contents of an InputStream as a String using the default character encoding of the platform.
//      * This method buffers the input internally, so there is no need to use a BufferedInputStream.
//      * @param inputStream the InputStream to read from
//      * @return the contents of the inputStream
//      * @throws IOException - if an I/O error occurs
//      */
//     public String toString(final InputStream inputStream) throws IOException {
//         return org.apache.commons.io.IOUtils.toString(inputStream);
//     }
// }
// 
// Path: gepard-gherkin-jbehave/src/main/java/com/epam/gepard/gherkin/jbehave/helper/ResourceProvider.java
// public class ResourceProvider {
// 
//     /**
//      * Returns the resource with the given path from the classpath.
//      * @param path the given path of the resource
//      * @return an {@link InputStream} of the resource, or null if not found
//      */
//     public InputStream getResourceAsStream(final String path) {
//         return getClass().getClassLoader().getResourceAsStream(path);
//     }
// 
// }


// Path: gepard-gherkin-jbehave/src/test/java/com/epam/gepard/gherkin/jbehave/JBehaveStoryReporterTest.java
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.internal.util.reflection.Whitebox;
import com.epam.gepard.gherkin.jbehave.helper.IOUtils;
import com.epam.gepard.gherkin.jbehave.helper.ResourceProvider;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import org.jbehave.core.model.Story;
import org.junit.Before;

        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase, never()).logComment(Mockito.anyString());
    }

    @Test
    public void testBeforeStoryShouldNotLogBeforeStories() {
        //GIVEN
        Story story = new Story(BEFORE_STORIES_PATH);
        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase, never()).logComment(Mockito.anyString());
    }

    @Test
    public void testBeforeStoryShouldLogStoryAsComment() {
        //GIVEN
        Story story = new Story("path");
        given(resourceProvider.getResourceAsStream("path")).willReturn(inputStream);
        //WHEN
        underTest.beforeStory(story, false);
        //THEN
        verify(jBehaveTestCase).logComment("Using story file: path", "<pre>something</pre>");
    }

    @Test
    public void testBeforeStoryShouldReportWhenStoryDoesNotExist() {
        //GIVEN
        Story story = new Story("fakepath");