package com.vmichalak.sonoscontroller;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;

/*
@RunWith(MockitoJUnitRunner.class)
public class ParserHelperTest {

    @Test
    public void testFindOneInXML() {
        String xml = "<?xml version=\"1.0\"?>\n" +
                "<catalog>\n" +
                "   <book id=\"bk101\">\n" +
                "      <author>Gambardella, Matthew</author>\n" +
                "      <title>XML Developer's Guide</title>\n" +
                "      <genre>Computer</genre>\n" +
                "      <price>44.95</price>\n" +
                "      <publish_date>2000-10-01</publish_date>\n" +
                "      <description>An in-depth look at creating applications \n" +
                "      with XML.</description>\n" +
                "   </book>" +
                "</catalog>";

        assertEquals("Computer", ParserHelper.findOne("<genre>(.*)</genre>", xml));
    }

}
*/
package com.vmichalak.sonoscontroller;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;

import static org.junit.Assert.assertEquals;

@RunWith(PowerMockRunner.class)
public class ParserHelperTest {

    @Test
    public void testFindOneInXML() {
        String xml = "<?xml version=\"1.0\"?>\n" +
                "<catalog>\n" +
                "   <book id=\"bk101\">\n" +
                "      <author>Gambardella, Matthew</author>\n" +
                "      <title>XML Developer's Guide</title>\n" +
                "      <genre>Computer</genre>\n" +
                "      <price>44.95</price>\n" +
                "      <publish_date>2000-10-01</publish_date>\n" +
                "      <description>An in-depth look at creating applications \n" +
                "      with XML.</description>\n" +
                "   </book>" +
                "</catalog>";

        assertEquals("Computer", ParserHelper.findOne("<genre>(.*)</genre>", xml));
    }
}
Correct Unit Test Runner