updated from master

This commit is contained in:
Sara Aspery
2017-06-15 11:04:23 +01:00
parent 28356584c1
commit 95a406cb30
3 changed files with 44 additions and 8 deletions

View File

@@ -35,13 +35,7 @@ import static org.springframework.http.HttpStatus.CREATED;
import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
import static org.testng.Assert.assertEquals;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
import org.alfresco.rest.rm.community.model.record.Record;
@@ -153,7 +147,7 @@ public class CompleteRecordTests extends BaseRMRestTest
}
/**
* Incomplete records with mandatory meta-data missing
* Record to be completed is frozen
*/
@DataProvider (name = "FrozenRecords")
public Object[][] getFrozenRecords() throws Exception
@@ -330,6 +324,7 @@ public class CompleteRecordTests extends BaseRMRestTest
private void createMandatoryMetadata()
{
}
private void setMandatoryMetadata(Record record)

View File

@@ -283,7 +283,7 @@ public class RecordsEntityResource implements BinaryResourceAction.Read,
}
else
{
throw new IntegrityException("Model integrity exception: the record is already completed.", null);
throw new IntegrityException("Model integrity exception: the record is frozen or already completed.", null);
}
// return record state

View File

@@ -1799,6 +1799,47 @@ paths:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/records/{recordId}/complete':
post:
tags:
- records
summary: Complete a record
description: |
Completes the record **recordId**.
operationId: completeRecord
parameters:
- $ref: '#/parameters/recordIdParam'
- $ref: '#/parameters/recordEntryIncludeParam'
- $ref: '#/parameters/fieldsParam'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/RecordEntry'
'400':
description: |
Invalid parameter: **recordIdParam** is not a valid format or
**recordIdParam** is not a record
'401':
description: Authentication failed
'403':
description: >-
Current user does not have permission to complete record
**recordIdParam**
'404':
description: |
**recordIdParam** does not exist
'422':
description: |
Model integrity exception: the record is frozen or already completed
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
## Files
'/files/{fileId}/declare':
post: