@@ -0,0 +1,2388 @@
+/*%0A * #%25L%0A * ACS AEM Commons Bundle%0A * %25%25%0A * Copyright (C) 2018 Adobe%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0Apackage com.adobe.acs.commons.mcp.form;%0A%0Aimport org.apache.sling.api.SlingHttpServletRequest;%0Aimport org.apache.sling.api.resource.Resource;%0Aimport org.apache.sling.api.resource.ValueMap;%0Aimport org.apache.sling.api.scripting.SlingScriptHelper;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.mockito.Mockito.*;%0Aimport static org.junit.Assert.*;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class RadioComponentTest %7B%0A%0A    @Mock%0A    private FormField formField;%0A%0A    @Mock%0A    private SlingScriptHelper sling;%0A%0A    @Mock%0A    private SlingHttpServletRequest request;%0A%0A    @Before%0A    public void setup() %7B%0A        when(sling.getRequest()).thenReturn(request);%0A    %7D%0A%0A    @Test%0A    public void testRadioComponentDoesntSetFieldLabelOrDescription() %7B%0A        when(formField.options()).thenReturn(new String%5B0%5D);%0A        when(formField.name()).thenReturn(%22NAME%22);%0A        when(formField.description()).thenReturn(%22DESCRIPTION%22);%0A%0A        RadioComponent cmp = new RadioComponent() %7B%0A            @Override%0A            public Map%3CString, String%3E getOptions() %7B%0A                return new HashMap%3CString, String%3E() %7B%7B%0A                    put(%22v1%22, %22t1%22);%0A                    put(%22v2%22, %22t2%22);%0A                    put(%22v3%22, %22t3%22);%0A                %7D%7D;%0A            %7D%0A        %7D;%0A        cmp.setup(%22test%22, null, formField, sling);%0A%0A        Resource r = cmp.buildComponentResource();%0A        ValueMap map = r.getValueMap();%0A        assertEquals(%22NAME%22, map.get(%22text%22));%0A        assertFalse(map.containsKey(%22fieldLabel%22));%0A        assertFalse(map.containsKey(%22fieldDescription%22));%0A%0A    %7D%0A%7D%0A

add unit test