Author: dkuleshov
Date: 2011-02-01 09:14:32 -0500 (Tue, 01 Feb 2011)
New Revision: 3909
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/CopyCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestCopy.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMkCol.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMove.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPut.java
Log:
EXOJCR-1122: yet another tests fix and UriBuilder passing instead of URI to commands
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -73,7 +73,6 @@
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.net.URI;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
@@ -397,7 +396,7 @@
this.repositoryService = repositoryService;
this.nullResourceLocks = new NullResourceLocksHolder();
}
-
+
/**
* {@inheritDoc}
*/
@@ -479,8 +478,6 @@
{
String serverURI =
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName).build().toString();
- URI destinationUri =
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName).path(repoPath).build();
-
destinationHeader = TextUtil.unescape(destinationHeader, '%');
if (!destinationHeader.startsWith(serverURI))
@@ -522,11 +519,13 @@
if (srcWorkspace.equals(destWorkspace))
{
Session session = session(repoName, destWorkspace, lockTokens);
- return new CopyCommand(destinationHeader).copy(session, srcNodePath,
destNodePath);
+ return new
CopyCommand(uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).copy(session,
+ srcNodePath, destNodePath);
}
Session destSession = session(repoName, destWorkspace, lockTokens);
- return new CopyCommand(destinationHeader).copy(destSession, srcWorkspace,
srcNodePath, destNodePath);
+ return new
CopyCommand(uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).copy(destSession,
+ srcWorkspace, srcNodePath, destNodePath);
}
else if (depth.getIntValue() == 0)
@@ -537,9 +536,8 @@
Session session = session(repoName, destWorkspace, lockTokens);
- return new MkColCommand(nullResourceLocks, destinationUri).mkCol(session,
destNodePath + "/"
- + nodeName,
- defaultFolderNodeType, null, lockTokens);
+ return new MkColCommand(nullResourceLocks,
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName))
+ .mkCol(session, destNodePath + "/" + nodeName,
defaultFolderNodeType, null, lockTokens);
}
else
@@ -642,8 +640,8 @@
int dash = token.indexOf("-");
if (dash == -1)
{
- return
Response.status(HTTPStatus.REQUESTED_RANGE_NOT_SATISFIABLE).entity(
- "Requested Range Not Satisfiable").build();
+ return Response.status(HTTPStatus.REQUESTED_RANGE_NOT_SATISFIABLE)
+ .entity("Requested Range Not Satisfiable").build();
}
else if (dash == 0)
{
@@ -816,8 +814,6 @@
@HeaderParam(ExtHttpHeaders.CONTENT_MIXINTYPES) String mixinTypesHeader, @Context
UriInfo uriInfo)
{
-
-
if (log.isDebugEnabled())
{
log.debug("MKCOL " + repoName + "/" + repoPath);
@@ -835,10 +831,8 @@
nodeType = defaultFolderNodeType;
}
- URI destinationUri =
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName).path(repoPath).build();
-
- return new MkColCommand(nullResourceLocks, destinationUri).mkCol(session,
path(repoPath), nodeType,
- NodeTypeUtil.getMixinTypes(mixinTypesHeader), tokens);
+ return new MkColCommand(nullResourceLocks,
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).mkCol(
+ session, path(repoPath), nodeType,
NodeTypeUtil.getMixinTypes(mixinTypesHeader), tokens);
}
catch (NoSuchWorkspaceException exc)
{
@@ -917,12 +911,14 @@
if (srcWorkspace.equals(destWorkspace))
{
Session session = session(repoName, srcWorkspace, lockTokens);
- return new MoveCommand(destinationHeader).move(session, srcNodePath,
destNodePath);
+ return new
MoveCommand(uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).move(session,
+ srcNodePath, destNodePath);
}
Session srcSession = session(repoName, srcWorkspace, lockTokens);
Session destSession = session(repoName, destWorkspace, lockTokens);
- return new MoveCommand(destinationHeader).move(srcSession, destSession,
srcNodePath, destNodePath);
+ return new
MoveCommand(uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).move(srcSession,
+ destSession, srcNodePath, destNodePath);
}
else
{
@@ -955,9 +951,9 @@
"<DAV:basicsearch>" + "<exo:sql
xmlns:exo=\"http://exoplatform.com/jcr\"/>"
+ "<exo:xpath
xmlns:exo=\"http://exoplatform.com/jcr\"/>";
- return Response.ok().header(ExtHttpHeaders.ALLOW, /* allowCommands
*/ALLOW).header(ExtHttpHeaders.DAV,
- "1, 2, ordered-collections,
access-control").header(ExtHttpHeaders.DASL,
DASL_VALUE).header(ExtHttpHeaders.MSAUTHORVIA, "DAV")
- .build();
+ return Response.ok().header(ExtHttpHeaders.ALLOW, /* allowCommands */ALLOW)
+ .header(ExtHttpHeaders.DAV, "1, 2, ordered-collections,
access-control")
+ .header(ExtHttpHeaders.DASL, DASL_VALUE).header(ExtHttpHeaders.MSAUTHORVIA,
"DAV").build();
}
/**
@@ -1093,9 +1089,6 @@
@HeaderParam(ExtHttpHeaders.CONTENT_MIXINTYPES) String mixinTypes,
@HeaderParam(ExtHttpHeaders.CONTENT_TYPE) MediaType mediatype, InputStream
inputStream, @Context UriInfo uriInfo)
{
-
- URI destinationUri =
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName).path(repoPath).build();
-
if (log.isDebugEnabled())
{
log.debug("PUT " + repoName + "/" + repoPath);
@@ -1134,10 +1127,9 @@
NodeType nodeType = ntm.getNodeType(contentNodeType);
NodeTypeUtil.checkContentResourceType(nodeType);
- return new PutCommand(nullResourceLocks, destinationUri).put(session,
path(repoPath), inputStream,
- fileNodeType,
- contentNodeType, NodeTypeUtil.getMixinTypes(mixinTypes), mimeType, encoding,
updatePolicyType,
- autoVersionType, tokens);
+ return new PutCommand(nullResourceLocks,
uriInfo.getBaseUriBuilder().path(getClass()).path(repoName)).put(
+ session, path(repoPath), inputStream, fileNodeType, contentNodeType,
+ NodeTypeUtil.getMixinTypes(mixinTypes), mimeType, encoding, updatePolicyType,
autoVersionType, tokens);
}
catch (NoSuchWorkspaceException exc)
@@ -1330,8 +1322,8 @@
return
Response.status(HTTPStatus.INTERNAL_ERROR).entity(exc.getMessage()).build();
}
}
-
- /**
+
+ /**
* Gives access to the current session.
*
* @param repoName repository name
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/CopyCommand.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/CopyCommand.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/CopyCommand.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -21,15 +21,16 @@
import org.exoplatform.common.http.HTTPStatus;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.ExtHttpHeaders;
import javax.jcr.AccessDeniedException;
import javax.jcr.ItemExistsException;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.Workspace;
import javax.jcr.lock.LockException;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
/**
* Created by The eXo Platform SAS Author : <a
@@ -47,26 +48,27 @@
private static Log log =
ExoLogger.getLogger("exo.jcr.component.webdav.CopyCommand");
/**
- * Provides URI information needed for 'location' header in 'CREATED'
response
- */
- private final String destination;
+ * Provides URI information needed for 'location' header in 'CREATED'
+ * response
+ */
+ private final UriBuilder uriBuilder;
/**
* Empty constructor
*/
public CopyCommand()
{
- this.destination = null;
+ this.uriBuilder = null;
}
/**
* Constructor
*
- * @param destination - provide data used in 'location' header
+ * @param uriBuilder - provide data used in 'location' header
*/
- public CopyCommand(String destination)
+ public CopyCommand(UriBuilder uriBuilder)
{
- this.destination = destination;
+ this.uriBuilder = uriBuilder;
}
/**
@@ -81,13 +83,14 @@
{
try
{
- destSession.getWorkspace().copy(sourcePath, destPath);
- if (destination != null)
+ Workspace workspace = destSession.getWorkspace();
+ workspace.copy(sourcePath, destPath);
+ if (uriBuilder != null)
{
- return Response.status(HTTPStatus.CREATED).header(ExtHttpHeaders.LOCATION,
destination).build();
+ return
Response.created(uriBuilder.path(workspace.getName()).path(destPath).build()).build();
}
- // to save compatibility for deprecated WebDavServiceImpl.put(..), which does
not provide uriInfo
+ // to save compatibility if uribuilder is not provided
return Response.status(HTTPStatus.CREATED).build();
}
catch (ItemExistsException e)
@@ -126,13 +129,14 @@
{
try
{
- destSession.getWorkspace().copy(sourceWorkspace, sourcePath, destPath);
- if (destination != null)
+ Workspace destWorkspace = destSession.getWorkspace();
+ destWorkspace.copy(sourceWorkspace, sourcePath, destPath);
+ if (uriBuilder != null)
{
- return Response.status(HTTPStatus.CREATED).header(ExtHttpHeaders.LOCATION,
destination).build();
+ return
Response.created(uriBuilder.path(destWorkspace.getName()).path(destPath).build()).build();
}
- // to save compatibility for deprecated WebDavServiceImpl.put(..), which does
not provide uriInfo
+ // to save compatibility if uriBuilder is not provided
return Response.status(HTTPStatus.CREATED).build();
}
catch (ItemExistsException e)
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MkColCommand.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -24,7 +24,6 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import java.net.URI;
import java.util.List;
import javax.jcr.AccessDeniedException;
@@ -35,6 +34,7 @@
import javax.jcr.Session;
import javax.jcr.lock.LockException;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
/**
* Created by The eXo Platform SAS Author : <a
@@ -59,7 +59,7 @@
/**
* Provides URI information needed for 'location' header in 'CREATED'
response
*/
- private final URI destinationUri;
+ private final UriBuilder uriBuilder;
/**
* Constructor.
@@ -69,19 +69,19 @@
public MkColCommand(final NullResourceLocksHolder nullResourceLocks)
{
this.nullResourceLocks = nullResourceLocks;
- this.destinationUri = null;
+ this.uriBuilder = null;
}
/**
* Constructor.
*
* @param nullResourceLocks resource locks.
- * @param uriInfo - provide data used in 'location' header
+ * @param uriBuilder - provide data used in 'location' header
*/
- public MkColCommand(final NullResourceLocksHolder nullResourceLocks, URI serverUri)
+ public MkColCommand(final NullResourceLocksHolder nullResourceLocks, UriBuilder
uriBuilder)
{
this.nullResourceLocks = nullResourceLocks;
- this.destinationUri = serverUri;
+ this.uriBuilder = uriBuilder;
}
/**
@@ -138,12 +138,12 @@
return Response.serverError().entity(exc.getMessage()).build();
}
- if (destinationUri != null)
+ if (uriBuilder != null)
{
- return Response.created(destinationUri).build();
+ return
Response.created(uriBuilder.path(session.getWorkspace().getName()).path(path).build()).build();
}
- // to save compatibility for deprecated WebDavServiceImpl.put(..), which does not
provide uriInfo
+ // to save compatibility if uriBuilder is not provided
return Response.status(HTTPStatus.CREATED).build();
}
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/MoveCommand.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -21,7 +21,6 @@
import org.exoplatform.common.http.HTTPStatus;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.ExtHttpHeaders;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
@@ -29,6 +28,7 @@
import javax.jcr.lock.LockException;
import javax.ws.rs.core.CacheControl;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
/**
* Created by The eXo Platform SAS Author : <a
@@ -52,7 +52,7 @@
/**
* Provides URI information needed for 'location' header in 'CREATED'
response
*/
- private final String destination;
+ private final UriBuilder uriBuilder;
// Fix problem with moving under Windows Explorer.
static
@@ -65,16 +65,17 @@
*/
public MoveCommand()
{
- this.destination = null;
+ this.uriBuilder = null;
}
/**
* Constructor to receive URI Info
- * @param destination - provide data used in 'location' header
+ *
+ * @param uriBuilder - provide data used in 'location' header
*/
- public MoveCommand(String destination)
+ public MoveCommand(UriBuilder uriBuilder)
{
- this.destination = destination;
+ this.uriBuilder = uriBuilder;
}
/**
@@ -105,13 +106,13 @@
}
else
{
- if (destination != null)
+ if (uriBuilder != null)
{
- return Response.status(HTTPStatus.CREATED).header(ExtHttpHeaders.LOCATION,
destination)
+ return
Response.created(uriBuilder.path(session.getWorkspace().getName()).path(destPath).build())
.cacheControl(cacheControl).build();
}
- // to save compatibility for deprecated WebDavServiceImpl.move(..), which
does not provide uriInfo
+ // to save compatibility if uriBuilder is not provided
return
Response.status(HTTPStatus.CREATED).cacheControl(cacheControl).build();
}
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.webdav.util.TextUtil;
import java.io.InputStream;
-import java.net.URI;
import java.util.Calendar;
import java.util.List;
@@ -34,6 +33,7 @@
import javax.jcr.Session;
import javax.jcr.lock.LockException;
import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
/**
* Created by The eXo Platform SAS Author : <a
@@ -51,9 +51,10 @@
private final NullResourceLocksHolder nullResourceLocks;
/**
- * Provides URI information needed for 'location' header in 'CREATED'
response
+ * Provides URI information needed for 'location' header in 'CREATED'
+ * response
*/
- private final URI destinationUri;
+ private final UriBuilder uriBuilder;
/**
* Constructor.
@@ -63,19 +64,19 @@
public PutCommand(final NullResourceLocksHolder nullResourceLocks)
{
this.nullResourceLocks = nullResourceLocks;
- this.destinationUri = null;
+ this.uriBuilder = null;
}
/**
- * Constructor.
- *
- * @param nullResourceLocks resource locks.
- * @param uriInfo - provide data used in 'location' header
- */
- public PutCommand(final NullResourceLocksHolder nullResourceLocks, URI
destinationUri)
+ * Constructor.
+ *
+ * @param nullResourceLocks resource locks.
+ * @param uriBuilder - provide data used in 'location' header
+ */
+ public PutCommand(final NullResourceLocksHolder nullResourceLocks, UriBuilder
uriBuilder)
{
this.nullResourceLocks = nullResourceLocks;
- this.destinationUri = destinationUri;
+ this.uriBuilder = uriBuilder;
}
/**
@@ -171,14 +172,12 @@
{
return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage()).build();
}
- if (destinationUri != null)
+ if (uriBuilder != null)
{
- // String destination = destinationUri + "/" +
session.getWorkspace().getName() + path;
- // return
Response.status(HTTPStatus.CREATED).header(ExtHttpHeaders.LOCATION, destination).build();
- return Response.created(destinationUri).build();
+ return
Response.created(uriBuilder.path(session.getWorkspace().getName()).path(path).build()).build();
}
- // to save compatibility for deprecated WebDavServiceImpl.put(..), which does not
provide uriInfo
+ // to save compatibility if uriBuilder is not provided
return Response.status(HTTPStatus.CREATED).build();
}
@@ -221,7 +220,7 @@
* Updates jcr:content node.
*
* @param node parent node
- * @param inputStream inputStream input stream that contains the content of
+ * @param inputStream inputStream input stream that contains the content of
* file
* @param mimeType content type
* @param mixins list of mixins
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestCopy.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestCopy.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestCopy.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -127,7 +127,7 @@
// check if response 'CREATED' contains 'LOCATION' header
assertTrue(response.getHttpHeaders().containsKey(ExtHttpHeaders.LOCATION));
// check if 'CREATED' response 'LOCATION' header contains correct
location path
-
assertTrue(response.getHttpHeaders().get(ExtHttpHeaders.LOCATION).toString().contains(getPathWS()
+ destFilename));
+ assertEquals(getPathWS() + destFilename,
response.getHttpHeaders().getFirst(ExtHttpHeaders.LOCATION).toString());
}
@Override
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMkCol.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMkCol.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMkCol.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -77,7 +77,8 @@
// here we check if response 'CREATED' contains 'LOCATION' header
assertTrue(response.getHttpHeaders().containsKey(ExtHttpHeaders.LOCATION));
// here we check if 'CREATED' response 'LOCATION' header contains
correct location path
-
assertTrue(response.getHttpHeaders().get(ExtHttpHeaders.LOCATION).toString().contains(getPathWS()
+ folder));
+ assertEquals(getPathWS() + folder,
response.getHttpHeaders().getFirst(ExtHttpHeaders.LOCATION).toString());
+
}
@Override
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMove.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMove.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestMove.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -112,7 +112,7 @@
// check if 'CREATED' response contains 'LOCATION' header
assertTrue(response.getHttpHeaders().containsKey(ExtHttpHeaders.LOCATION));
// check if 'CREATED' response 'LOCATION' header contains correct
location path
-
assertTrue(response.getHttpHeaders().get(ExtHttpHeaders.LOCATION).toString().contains(getPathWS()
+ destFilename));
+ assertEquals(getPathWS() + destFilename,
response.getHttpHeaders().getFirst(ExtHttpHeaders.LOCATION).toString());
}
@Override
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPut.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPut.java 2011-02-01
10:54:55 UTC (rev 3908)
+++
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPut.java 2011-02-01
14:14:32 UTC (rev 3909)
@@ -164,8 +164,8 @@
// check if response 'CREATED' contains 'LOCATION' header
assertTrue(containerResponse.getHttpHeaders().containsKey(ExtHttpHeaders.LOCATION));
// check if 'CREATED' response 'LOCATION' header contains correct
location path
-
assertTrue(containerResponse.getHttpHeaders().get(ExtHttpHeaders.LOCATION).toString()
- .contains(getPathWS() + filename));
+ assertEquals(getPathWS() + filename,
containerResponse.getHttpHeaders().getFirst(ExtHttpHeaders.LOCATION)
+ .toString());
}
@Override