REPO-1773: Validate ticket API call returns incorrect body with 404 status code

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134044 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2017-01-04 15:39:39 +00:00
parent d7177c4d34
commit dee0895e4a
2 changed files with 10 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ import org.alfresco.rest.api.People;
import org.alfresco.rest.api.model.LoginTicket;
import org.alfresco.rest.api.model.LoginTicketResponse;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.core.exceptions.NotFoundException;
import org.alfresco.rest.framework.core.exceptions.PermissionDeniedException;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.rest.framework.webscripts.WithResponse;
@@ -114,12 +115,12 @@ public class AuthenticationsImpl implements Authentications
// or the user is not fully authenticated
if (currentUser == null || !currentUser.equals(ticketUser))
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
}
catch (AuthenticationException e)
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
LoginTicketResponse response = new LoginTicketResponse();
response.setId(ticket);
@@ -144,7 +145,7 @@ public class AuthenticationsImpl implements Authentications
// or the user is not fully authenticated
if (currentUser == null || !currentUser.equals(ticketUser))
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
else
{
@@ -154,7 +155,7 @@ public class AuthenticationsImpl implements Authentications
}
catch (AuthenticationException e)
{
withResponse.setStatus(Status.STATUS_NOT_FOUND);
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID, new String[] { ticket });
}
}