def METHOD_NAME(app, db, minimal_oai_record, recid_pid):
    """Test license code."""
    obj = openaire_json_v1.transform_record(
        recid_pid, Record(minimal_oai_record))
    assert obj['licenseCode'] == 'OPEN'
    minimal_oai_record['access_right'] = 'restricted'
    obj = openaire_json_v1.transform_record(
        recid_pid, Record(minimal_oai_record))
    assert obj['licenseCode'] == 'RESTRICTED'
    minimal_oai_record['access_right'] = 'embargoed'
    minimal_oai_record['embargo_date'] = '2017-04-22'
    obj = openaire_json_v1.transform_record(
        recid_pid, Record(minimal_oai_record))
    assert obj['licenseCode'] == 'EMBARGO'
    assert obj['embargoEndDate'] == '2017-04-22'