package com.bynder.sdk.query.upload;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

/**
 * Tests the {@link SaveMediaQuery} class methods.
 */
public class SaveMediaQueryTest {

    public static final String EXPECTED_IMPORT_ID = "importId";
    public static final String EXPECTED_BRAND_ID = "brandId";
    public static final String EXPECTED_NAME = "name";
    public static final String EXPECTED_MEDIA_ID = "mediaId";
    public static final String EXPECTED_METAPROPERTY_ID = "metapropertyId";
    public static final String EXPECTED_OPTION_NAME = "optionName";

    @Test
    public void initializeSaveMediaQuery() {
        SaveMediaQuery saveMediaQuery = new SaveMediaQuery(EXPECTED_IMPORT_ID);
        saveMediaQuery.setBrandId(EXPECTED_BRAND_ID);
        saveMediaQuery.setName(EXPECTED_NAME);
        saveMediaQuery.setMediaId(EXPECTED_MEDIA_ID);
        saveMediaQuery.setMetaproperty(EXPECTED_METAPROPERTY_ID, EXPECTED_OPTION_NAME);

        assertEquals(EXPECTED_IMPORT_ID, saveMediaQuery.getImportId());
        assertEquals(EXPECTED_BRAND_ID, saveMediaQuery.getBrandId());
        assertEquals(EXPECTED_NAME, saveMediaQuery.getName());
        assertEquals(EXPECTED_MEDIA_ID, saveMediaQuery.getMediaId());
        assertEquals(1, saveMediaQuery.getMetaproperties().size());
    }
}

@@ -88,20 +88,123 @@
 ort 
-org.junit.Te
+com.bynder.sdk.query.MetapropertyAttribute;%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Li
 st;%0A
@@ -1413,11 +1413,450 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testMetaProperties() %7B%0A        SaveMediaQuery saveMediaQuery = new SaveMediaQuery(EXPECTED_IMPORT_ID);%0A        List%3CMetapropertyAttribute%3E metapropertyAttributes = new ArrayList%3C%3E();%0A        metapropertyAttributes.add(new MetapropertyAttribute(EXPECTED_METAPROPERTY_ID, new String%5B%5D%7BEXPECTED_OPTION_NAME%7D));%0A%0A        assertEquals(metapropertyAttributes.size(), saveMediaQuery.getMetaproperties().size());%0A%0A    %7D
 %0A%7D%0A

add saveMediaQuery#setMetaproperties test