<commit_before>package org.mockito.release.internal.gradle

import org.mockito.release.gradle.ReleaseConfiguration
import org.mockito.release.internal.gradle.util.team.TeamParser
import spock.lang.Specification

class ReleaseConfigurationTest extends Specification {

    def conf = new ReleaseConfiguration()

    def "default values"() {
        conf.team.developers.empty
        conf.team.contributors.empty
    }

    def "custom commitMessagePostfix"() {
        //TODO figure out a test that would validate all properties with reflection
        //rather than implement individual unit test for each property (getter and setter)
        conf.git.commitMessagePostfix = " by CI build 1234 [ci skip-release]"

        expect:
        conf.git.commitMessagePostfix ==  " by CI build 1234 [ci skip-release]"
    }

    def "empty build settings are ok"() {
        expect:
        conf.build.commitMessage == null
        !conf.build.pullRequest
    }

    def "validates team members"() {
        conf.team.developers = []
        conf.team.developers = ["foo:bar"]
        conf.team.developers = ["foo:bar", "x:y"]

        conf.team.contributors = []
        conf.team.contributors = ["foo:bar"]
        conf.team.contributors = ["foo:bar", "x:y"]
    }

    def "fails when team members have wrong format"() {
        when: conf.team.developers = [""]
        then: thrown(TeamParser.InvalidInput.class)

        when: conf.team.contributors = ["ala:"]
        then: thrown(TeamParser.InvalidInput.class)
    }
}<commit_msg>Fixed bad test<commit_after>package org.mockito.release.internal.gradle

import org.mockito.release.gradle.ReleaseConfiguration
import org.mockito.release.internal.gradle.util.team.TeamParser
import spock.lang.Specification

class ReleaseConfigurationTest extends Specification {

    def conf = new ReleaseConfiguration()

    def "default values"() {
        conf.team.developers.empty
        conf.team.contributors.empty
    }

    def "custom commitMessagePostfix"() {
        //TODO figure out a test that would validate all properties with reflection
        //rather than implement individual unit test for each property (getter and setter)
        conf.git.commitMessagePostfix = " by CI build 1234 [ci skip-release]"

        expect:
        conf.git.commitMessagePostfix ==  " by CI build 1234 [ci skip-release]"
    }

    def "empty build settings are ok"() {
        expect:
        conf.build.commitMessage == null
        !conf.build.pullRequest
    }

    def "validates team members"() {
        when:
        conf.team.developers = []
        conf.team.developers = ["foo:bar"]
        conf.team.developers = ["foo:bar", "x:y"]

        conf.team.contributors = []
        conf.team.contributors = ["foo:bar"]
        conf.team.contributors = ["foo:bar", "x:y"]

        then:
        noExceptionThrown()
    }

    def "fails when team members have wrong format"() {
        when: conf.team.developers = [""]
        then: thrown(TeamParser.InvalidInput.class)

        when: conf.team.contributors = ["ala:"]
        then: thrown(TeamParser.InvalidInput.class)
    }
}
{'fraction_non_alphanumeric': 0.11025641025641025, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 2.693491124260355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4944076', 'n_tokens_mistral': 929, 'n_tokens_neox': 870, 'n_words': 217}