<commit_before>package de.mvitz.jprops.core.api;

import static org.mockito.BDDMockito.given;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class PropertiesInjectorTest {

    @Mock
    private PropertyProvider provider;
    @InjectMocks
    private PropertiesInjector injector;

    @SuppressWarnings("unused")
    private UnknownType unknownType;

    @Test(expected = InvalidPropertiesException.class)
    public void shouldThrowExceptionForUnknownType() throws Exception {
        given(provider.get("unknownType")).willReturn("foo");
        injector.injectInto(this);
    }

    public interface UnknownType {
    }

}<commit_msg>Use AssertJ instead of JUnit expected to assert thrown exception.<commit_after>package de.mvitz.jprops.core.api;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
import static org.mockito.BDDMockito.given;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class PropertiesInjectorTest {

    @Mock
    private PropertyProvider provider;
    @InjectMocks
    private PropertiesInjector injector;

    private UnknownType unknownType;

    @Test
    public void shouldThrowExceptionForUnknownType() throws Exception {
        given(provider.get("unknownType")).willReturn("foo");
        try {
            injector.injectInto(this);
            failBecauseExceptionWasNotThrown(InvalidPropertiesException.class);
        } catch (final InvalidPropertiesException e) {
            assertThat(e).hasNoCause().hasMessage("No converter found for type: UnknownType");
            assertThat(unknownType).isNull();
        }
    }

    public interface UnknownType {
    }

}
{'fraction_non_alphanumeric': 0.08877805486284289, 'fraction_numerical': 0.0, 'mean_word_length': 4.196891191709844, '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': '3140423', 'n_tokens_mistral': 574, 'n_tokens_neox': 568, 'n_words': 112}