Background:
I'd like to build an http API service to get my specific cases called. So, I need to write a controller method to call feature files.
Issue I can call the feature successfully within the src/test/java folder.
However, it throws an exception "not found: com/example/springboot/e2e/from-java.feature", when I write the same code under src/test/java folder.
code under src/test/java folder, it works
@Test
public void testCallingClasspathFeatureFromJava() {
Map<String, Object> args = new HashMap();
args.put("name", "World");
Map<String, Object> result = Runner.runFeature("classpath:com/example/springboot/e2e/from-java.feature",args,true);
assertEquals("Hello World", result.get("greeting"));
}
code under src/test/main folder, it failed exception: "not found com/example/springboot/e2e/from-java.feature" **
public class FeatureCaseRunner {
public static void main(String[] args) {
Map<String, Object> params = new HashMap();
params.put("name", "World");
Map<String, Object> result = Runner.runFeature("classpath:com/example/springboot/e2e/from-java.feature",params,true);
assertEquals("Hello World", result.get("greeting"));
}
}