<commit_before>/*
 * Copyright 2015 yihtserns.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.yihtserns.camelscript;

import org.apache.camel.StartupListener;
import org.apache.camel.TypeConverter;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.converter.DefaultTypeConverter;
import org.apache.camel.spi.TypeConverterRegistry;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.*;

/**
 * @author yihtserns
 */
public class StartLaterDefaultTypeConverterTest {

    @Test
    public void shouldAddItselfIntoCamelContext() throws Exception {
        DefaultCamelContext camelContext = spy(new DefaultCamelContext());
        StartLaterDefaultTypeConverter.registerInto(camelContext);

        verify(camelContext).setTypeConverter((TypeConverter) argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
        verify(camelContext).setTypeConverterRegistry((TypeConverterRegistry) argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
        verify(camelContext).addService(argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
    }

    @Test
    public void hopefullyDoesNotImplementStartupListener() {
        assertThat("DefaultTypeConverter changed to implement StartupListener, have to review "
                + StartLaterDefaultTypeConverter.class.getSimpleName()
                + " implementation",
                DefaultTypeConverter.class, not(typeCompatibleWith(StartupListener.class)));
    }
}
<commit_msg>Change test to accommodate Camel 2.15.0 behaviour.<commit_after>/*
 * Copyright 2015 yihtserns.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.yihtserns.camelscript;

import org.apache.camel.StartupListener;
import org.apache.camel.TypeConverter;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.converter.DefaultTypeConverter;
import org.apache.camel.spi.TypeConverterRegistry;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.*;

/**
 * @author yihtserns
 */
public class StartLaterDefaultTypeConverterTest {

    @Test
    public void shouldAddItselfIntoCamelContext() throws Exception {
        DefaultCamelContext camelContext = spy(new DefaultCamelContext());
        StartLaterDefaultTypeConverter.registerInto(camelContext);

        verify(camelContext).setTypeConverter((TypeConverter) argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
        verify(camelContext).setTypeConverterRegistry((TypeConverterRegistry) argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
        verify(camelContext, atLeastOnce()).addService(argThat(instanceOf(StartLaterDefaultTypeConverter.class)));
    }

    @Test
    public void hopefullyDoesNotImplementStartupListener() {
        assertThat("DefaultTypeConverter changed to implement StartupListener, have to review "
                + StartLaterDefaultTypeConverter.class.getSimpleName()
                + " implementation",
                DefaultTypeConverter.class, not(typeCompatibleWith(StartupListener.class)));
    }
}

{'fraction_non_alphanumeric': 0.08493664946034725, 'fraction_numerical': 0.004692632566870014, 'mean_word_length': 4.572549019607843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7325091', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1096, 'n_words': 291}