FieldTypes fieldTypesSnapshot = control.createMock(FieldTypes.class);
ValueType valueType = new StringValueType();
IdGenerator idGenerator = new IdGeneratorImpl();
recordFactory.newRecord();
expectLastCall().andReturn(new RecordImpl()).anyTimes();
repository.getIdGenerator();
expectLastCall().andReturn(idGenerator).anyTimes();
typeManager.getFieldTypesSnapshot();
expectLastCall().andReturn(fieldTypesSnapshot).anyTimes();
fieldTypesSnapshot.getFieldType(isA(QName.class));
expectLastCall().andReturn(fieldType).anyTimes();
fieldType.getValueType();
expectLastCall().andReturn(valueType).anyTimes();
typeManager.getValueType("STRING");
expectLastCall().andReturn(valueType).anyTimes();
control.replay();
Record record = new RecordImpl();
RecordId recordId = repository.getIdGenerator().newRecordId();
record.setId(recordId);
// Scope.NON_VERSIONED recordType and master record type are the same
record.setRecordType(Scope.NON_VERSIONED, new QName("ns", "nvrt"), 1L);
record.setRecordType(Scope.VERSIONED, new QName("ns", "vrt"), 2L);
record.setRecordType(Scope.VERSIONED_MUTABLE, new QName("ns", "vmrt"), 3L);
QName fieldName = new QName("ns", "aName");
record.setField(fieldName, "aValue");
QName fieldName2 = new QName("ns", "aName2");
record.setField(fieldName2, "aValue2");
record.addFieldsToDelete(Arrays.asList(new QName("devnull", "fieldToDelete")));
assertEquals(record, converter.convertRecord(converter.convert(record, repository), repository));
control.verify();
}