title: Error: java.lang.IllegalArgumentException: URI must not be null when using RestAssured in SpringBootTest aginst the RestTemplate
body: <p>This the <code>BaseTest</code> abstract class where the configuration is being set :</p>
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
  public abstract class BaseIntegration {
  
  @Value(&quot;${local.server.port}&quot;)
  private int serverPort;
  
  @Before
  public void setup() {
      RestAssured.port = serverPort;
  }}
  </code></pre>
  <p>The test class is very simple :</p>
  <pre><code>public class TestIT extends BaseIntegration{//Test Code}
  </code></pre>
  <p><code>RestClient</code> created using <code>RestAssured</code> :</p>
  <pre><code>public static TestResponse postResponse(TestRequest request) {
  
      return given().log().all()
              .contentType(ContentType.JSON)
              .body(request)
              .when()
              .log().all()
              .post(&quot;/weather&quot;)
              .as(TestResponse.class);
  
  }
  </code></pre>
  <p>When the test are running in teamcity this is what the error log says :</p>
  <pre><code>java.lang.IllegalArgumentException: URI must not be null
  at org.springframework.util.Assert.notNull(Assert.java:134) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.util.UriComponentsBuilder.fromUriString(UriComponentsBuilder.java:189) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.util.DefaultUriTemplateHandler.initUriComponentsBuilder(DefaultUriTemplateHandler.java:114) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.util.DefaultUriTemplateHandler.expandInternal(DefaultUriTemplateHandler.java:103) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.util.AbstractUriTemplateHandler.expand(AbstractUriTemplateHandler.java:106) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:612) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:407) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
  </code></pre>
  <p>I am not using the <code>RestTemplate</code> or <code>TestRestTemplate</code>. There is another test that is using that and that test is working fine. I am unable to understand what can be causing the problem.</p>
  <p><strong>EDIT:</strong></p>
  <p>Seems like the service endpoint is using <code>RestTemplate</code></p>
  <pre><code>restTemplate.postForEntity(url, body, TestResponse.class);
  </code></pre>
  <p>On calling the endpoint my test are failing. I am thinking that there are some compatilibily issue with <code>RestTemplate</code> and <code>RestAssured</code> libs.</p>