OLINGO-573: merging with master
This commit is contained in:
commit
f262563fa6
|
@ -108,6 +108,32 @@
|
|||
<artifactId>httpclient</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-logging-log4j</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jasper</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -68,6 +68,7 @@ import org.mockito.Mockito;
|
|||
public class ServiceDispatcherTest {
|
||||
private static final int TOMCAT_PORT = 9900;
|
||||
private Tomcat tomcat = new Tomcat();
|
||||
private String baseURL;
|
||||
|
||||
public class SampleODataServlet extends HttpServlet {
|
||||
private final ServiceHandler handler; // must be stateless
|
||||
|
@ -100,6 +101,7 @@ public class ServiceDispatcherTest {
|
|||
Context cxt = tomcat.addContext("/trippin", baseDir.getAbsolutePath());
|
||||
Tomcat.addServlet(cxt, "trippin", new SampleODataServlet(serviceHandler, edmProvider));
|
||||
cxt.addServletMapping("/*", "trippin");
|
||||
baseURL = "http://" + tomcat.getHost().getName() + ":"+ TOMCAT_PORT;
|
||||
tomcat.setPort(TOMCAT_PORT);
|
||||
tomcat.start();
|
||||
}
|
||||
|
|
|
@ -405,8 +405,8 @@ public class TripPinServiceTest {
|
|||
postRequest.addHeader("Prefer", "return=minimal");
|
||||
|
||||
HttpResponse response = httpSend(postRequest, 204);
|
||||
// the below woud be 204, if minimal was not supplied
|
||||
assertEquals("http://localhost:9900/trippin/People('olingodude')", getHeader(response, "Location"));
|
||||
// the below would be 204, if minimal was not supplied
|
||||
assertEquals(baseURL +"/People('olingodude')", getHeader(response, "Location"));
|
||||
assertEquals("return=minimal", getHeader(response, "Preference-Applied"));
|
||||
|
||||
String location = getHeader(response, "Location");
|
||||
|
|
Loading…
Reference in New Issue