<commit_before>package com.github.blindpirate.gogradle.core.dependency

import com.github.blindpirate.gogradle.GogradleRunner
import com.github.blindpirate.gogradle.vcs.git.GitDependencyManager
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock

import static org.mockito.Mockito.when

@RunWith(GogradleRunner)
class VendorNotationDependencyTest {
    @Mock
    AbstractNotationDependency hostNotationDependency

    VendorNotationDependency dependency = new VendorNotationDependency()

    @Before
    void setUp() {
        when(hostNotationDependency.getResolverClass()).thenReturn(GitDependencyManager)
    }

    @Test
    void 'setting hostDependency should success'() {
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.hostNotationDependency.is(hostNotationDependency)
    }

    @Test
    void 'setting vendorPath should success'() {
        dependency.vendorPath = 'vendor/a/b'
        assert dependency.vendorPath == 'vendor/a/b'
    }

    @Test
    void "a VendorNotationDependency's resolver class should be its host's"() {
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.resolverClass == GitDependencyManager
    }

    @Test
    void 'isConcrete should be delegated to hostDependency'() {
        when(hostNotationDependency.isConcrete()).thenReturn(true)
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.isConcrete()
    }
}<commit_msg>Improve test coverage of VendorNotationDependency<commit_after>package com.github.blindpirate.gogradle.core.dependency

import com.github.blindpirate.gogradle.GogradleRunner
import com.github.blindpirate.gogradle.vcs.git.GitDependencyManager
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock

import static org.mockito.Mockito.mock
import static org.mockito.Mockito.when

@RunWith(GogradleRunner)
class VendorNotationDependencyTest {
    @Mock
    AbstractNotationDependency hostNotationDependency

    VendorNotationDependency dependency = new VendorNotationDependency()

    @Before
    void setUp() {
        when(hostNotationDependency.getResolverClass()).thenReturn(GitDependencyManager)
    }

    @Test
    void 'setting hostDependency should success'() {
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.hostNotationDependency.is(hostNotationDependency)
    }

    @Test
    void 'setting vendorPath should success'() {
        dependency.vendorPath = 'vendor/a/b'
        assert dependency.vendorPath == 'vendor/a/b'
    }

    @Test
    void "a VendorNotationDependency's resolver class should be its host's"() {
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.resolverClass == GitDependencyManager
    }

    @Test
    void 'isConcrete should be delegated to hostDependency'() {
        when(hostNotationDependency.isConcrete()).thenReturn(true)
        dependency.hostNotationDependency = hostNotationDependency
        assert dependency.isConcrete()
    }

    @Test
    void 'equals should succeed'() {
        assert dependency != null
        assert vendorNotationDependency(hostNotationDependency, 'path1') == vendorNotationDependency(hostNotationDependency, 'path1')
        assert vendorNotationDependency(hostNotationDependency, 'path1') != vendorNotationDependency(hostNotationDependency, 'path2')
        assert vendorNotationDependency(hostNotationDependency, 'path1') != vendorNotationDependency(mock(NotationDependency), 'path1')
    }

    VendorNotationDependency vendorNotationDependency(NotationDependency host, String vendorPath) {
        VendorNotationDependency ret = new VendorNotationDependency()
        ret.vendorPath = vendorPath
        ret.hostNotationDependency = host
        return ret
    }
}
{'fraction_non_alphanumeric': 0.07666751852798365, 'fraction_numerical': 0.001533350370559673, 'mean_word_length': 4.190981432360743, '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': '4235708', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1036, 'n_words': 205}