# TestExecutor Gradle IntelliJ

**URL:** <https://discuss.gradle.org/t/testexecutor-gradle-intellij/22453>\
**Category:** Help/Discuss\
**Created:** [April 25, 2017, 2:49pm UTC](https://discuss.gradle.org/t/testexecutor-gradle-intellij/22453 "2017-04-25T14:49:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pivan9911](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@pivan9911](https://discuss.gradle.org/u/pivan9911)\
**Post date:** [April 25, 2017, 2:49pm UTC](https://discuss.gradle.org/t/testexecutor-gradle-intellij/22453/1 "2017-04-25T14:49:43Z")

</div>

Dear Gentlemen.

We have a problem with gradle(also 3.5), which does not exist in IntelliJ.

It is a jUnit-test, which tests REST-interface of a port, ( reachable as Camel REST-service(route)).

The jUnit-tests works fine, when fired from within IntelliJ.

But when fired from gradle, “gradle test “ it cannot reach the TCP-IP Ports.

I should add, the PORT, is made available by a SpringBoot process. Which needs to be  
started before the jUnit-test kicks in, this done with annotation @SpringBootTest

The test look as here below, Any idea welcome.

Kind regards

Ian Pea.

// @RunWith(SpringJUnit4ClassRunner.class)  
@SpringBootTest(classes = IdServiceApplication.class) // SpringBoot application  
public class RestTest {

public void searchInternalMaskTest() throws Exception {

```
String mask =
        producerTemplate.requestBodyAndHeaders(

              “http://localhost:9097/idservice/id/87654321/category/Current_Account/mask”, null,    
             headers, String.class);
assertNotNull(mask);
assertTrue(mask.contains("00000001"));

```

}
