<commit_before>package org.kuali.rice.core.api.uif

import org.junit.Test
import static org.junit.Assert.*
import org.junit.Ignore
import org.kuali.rice.core.test.JAXBAssert;

class RemotableAttributeFieldTest {

        private static final String XML1 =
        """<attributeField xmlns="http://rice.kuali.org/core/v2_0">
            <name>a_name</name>
          </attributeField>""";

        private static final String XML2 =
        """<attributeField xmlns="http://rice.kuali.org/core/v2_0">
            <name>a_name</name>
            <dataType>STRING</dataType>
            <shortLabel>a_shortLabel</shortLabel>
            <longLabel>a_longLabel</longLabel>
            <helpSummary>a_helpSummary</helpSummary>
            <helpConstraint>a_helpConstraint</helpConstraint>
            <helpDescription>a_helpDescription</helpDescription>
            <forceUpperCase>true</forceUpperCase>
            <minLength>1</minLength>
            <maxLength>1</maxLength>
            <minValue>-10</minValue>
            <maxValue>99</maxValue>
            <regexConstraint>\\w</regexConstraint>
            <regexContraintMsg>a_regexContraintMsg</regexContraintMsg>
            <required>true</required>
            <defaultValues>
                <defaultValue>foo</defaultValue>
                <defaultValue>bar</defaultValue>
            </defaultValues>
            <select>
                <keyLabels>
                    <entry key="foo">foo</entry>
                    <entry key="bar">bar</entry>
                </keyLabels><groups/>
                <multiple>true</multiple>
            </select>
            <widgets>
                <quickFinder>
                    <baseLookupUrl>http://foo.bar</baseLookupUrl>
                    <dataObjectClass>FooBo</dataObjectClass>
                    <lookupParameters/>
                    <fieldConversions/>
                </quickFinder>
            </widgets>
          </attributeField>""";

    @Test
    void testHappyPath() {
        RemotableAttributeField o = create().build();
        assertNotNull(o);
    }

    @Test
    void testHappyPath2() {
        RemotableAttributeField.Builder o = create2();
        assertNotNull(o.build());
    }

    @Test
    void testOptional() {
        RemotableAttributeField.Builder o = create();
        o.dataType = null
        o.shortLabel = null
        o.helpSummary = null
        o.helpConstraint = null
        o.helpDescription = null
        o.minLength = null
        o.maxLength = null
        o.minValue = null
        o.maxValue = null
        o.regexConstraint = null
        o.regexContraintMsg = null
        o.defaultValues = null
        o.control = null
        o.widgets = null
        assertNotNull(o.build());
    }

    @Test
    void testOptional2() {
        RemotableAttributeField.Builder o = create();
        o.widgets = []
        o.defaultValues = []
        assertNotNull(o.build());
    }

    @Test(expected=IllegalArgumentException.class)
    void testNullName() {
        RemotableAttributeField.Builder o = RemotableAttributeField.Builder.create(null);

        assertNotNull(o.build());
    }<commit_msg>KULRICE-5404: fixing test<commit_after>package org.kuali.rice.core.api.uif

import org.junit.Test
import static org.junit.Assert.*
import org.junit.Ignore
import org.kuali.rice.core.test.JAXBAssert;

class RemotableAttributeFieldTest {

        private static final String XML1 =
        """<attributeField xmlns="http://rice.kuali.org/core/v2_0">
            <name>a_name</name>
          </attributeField>""";

        private static final String XML2 =
        """<attributeField xmlns="http://rice.kuali.org/core/v2_0">
            <name>a_name</name>
            <dataType>STRING</dataType>
            <shortLabel>a_shortLabel</shortLabel>
            <longLabel>a_longLabel</longLabel>
            <helpSummary>a_helpSummary</helpSummary>
            <helpConstraint>a_helpConstraint</helpConstraint>
            <helpDescription>a_helpDescription</helpDescription>
            <forceUpperCase>true</forceUpperCase>
            <minLength>1</minLength>
            <maxLength>1</maxLength>
            <minValue>-10</minValue>
            <maxValue>99</maxValue>
            <regexConstraint>\\w</regexConstraint>
            <regexContraintMsg>a_regexContraintMsg</regexContraintMsg>
            <required>true</required>
            <defaultValues>
                <defaultValue>foo</defaultValue>
                <defaultValue>bar</defaultValue>
            </defaultValues>
            <select>
                <keyLabels>
                    <entry key="foo">foo</entry>
                    <entry key="bar">bar</entry>
                </keyLabels><groups/>
                <multiple>true</multiple>
            </select>
            <widgets>
                <quickFinder>
                    <baseLookupUrl>http://foo.bar</baseLookupUrl>
                    <dataObjectClass>FooBo</dataObjectClass>
                    <lookupParameters/>
                    <fieldConversions/>
                </quickFinder>
            </widgets>
          </attributeField>""";

    @Test
    void testHappyPath() {
        RemotableAttributeField o = create().build();
        assertNotNull(o);
    }

    @Test
    void testHappyPath2() {
        RemotableAttributeField.Builder o = create2();
        assertNotNull(o.build());
    }

    @Test
    void testOptional() {
        RemotableAttributeField.Builder o = create();
        o.dataType = null
        o.shortLabel = null
        o.helpSummary = null
        o.helpConstraint = null
        o.helpDescription = null
        o.minLength = null
        o.maxLength = null
        o.minValue = null
        o.maxValue = null
        o.regexConstraint = null
        o.regexContraintMsg = null
        o.defaultValues = null
        o.control = null
        o.widgets = null
        assertNotNull(o.build());
    }

    @Test
    void testOptional2() {
        RemotableAttributeField.Builder o = create();
        o.widgets = []
        o.defaultValues = []
        assertNotNull(o.build());
    }

    @Test(expected=IllegalArgumentException.class)
    void testNullName() {
        RemotableAttributeField.Builder o = RemotableAttributeField.Builder.create((String) null);

        assertNotNull(o.build());
    }
{'fraction_non_alphanumeric': 0.11197216511149771, 'fraction_numerical': 0.00537719436976119, 'mean_word_length': 1.8995873452544705, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4234525', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1712, 'n_words': 265}