<commit_before>package com.github.liucijus.mock;

import com.github.liucijus.jinsist.mock.MethodToStubNotFound;
import com.github.liucijus.jinsist.mock.Mock;
import com.github.liucijus.mock.testtypes.Collaborator;
import com.github.liucijus.mock.testtypes.TestFactories;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class MockStubTest extends TestFactories {
    @Test
    public void stubsMethod() {
        Mock<Collaborator> collaboratorMock = new Mock<>(Collaborator.class, expectations);

        collaboratorMock.stub(mock -> mock.firstMethod("input")).returns("output");

        assertEquals(stub(Collaborator.class, firstMethod, argumentsOf("input"), "output"), registry.get(0));
    }

    @Test(expected = MethodToStubNotFound.class)
    public void failsOnPublicPropertyStubbing() {
        Mock<Collaborator> collaboratorMock = new Mock<>(Collaborator.class, expectations);
        collaboratorMock.stub(mock -> mock.publicProperty).returns("ignored");
    }

    public MockStubTest() throws NoSuchMethodException {
    }
}<commit_msg>Insert separating line<commit_after>package com.github.liucijus.mock;

import com.github.liucijus.jinsist.mock.MethodToStubNotFound;
import com.github.liucijus.jinsist.mock.Mock;
import com.github.liucijus.mock.testtypes.Collaborator;
import com.github.liucijus.mock.testtypes.TestFactories;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class MockStubTest extends TestFactories {
    @Test
    public void stubsMethod() {
        Mock<Collaborator> collaboratorMock = new Mock<>(Collaborator.class, expectations);

        collaboratorMock.stub(mock -> mock.firstMethod("input")).returns("output");

        assertEquals(stub(Collaborator.class, firstMethod, argumentsOf("input"), "output"), registry.get(0));
    }

    @Test(expected = MethodToStubNotFound.class)
    public void failsOnPublicPropertyStubbing() {
        Mock<Collaborator> collaboratorMock = new Mock<>(Collaborator.class, expectations);

        collaboratorMock.stub(mock -> mock.publicProperty).returns("ignored");
    }

    public MockStubTest() throws NoSuchMethodException {
    }
}
{'fraction_non_alphanumeric': 0.1151012891344383, 'fraction_numerical': 0.0009208103130755065, 'mean_word_length': 4.841397849462366, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '3833322', 'n_tokens_mistral': 651, 'n_tokens_neox': 653, 'n_words': 106}