Search in sources :

Example 1 with BundledConfigurationLocation

use of org.infernus.idea.checkstyle.model.BundledConfigurationLocation in project checkstyle-idea by jshiell.

the class CheckstylePluginApiTest method currentConfigurationCanBeVisited.

@Test
public void currentConfigurationCanBeVisited() {
    BundledConfigurationLocation googleChecks = new ConfigurationLocationFactory().create(GOOGLE_CHECKS, project);
    TreeSet<ConfigurationLocation> locations = new TreeSet<>();
    locations.add(googleChecks);
    when(pluginConfigManager.getCurrent()).thenReturn(PluginConfigurationBuilder.testInstance(CHECKSTYLE_VERSION).withLocations(locations).withActiveLocation(googleChecks).build());
    CheckstylePluginApi.ConfigurationVisitor visitor = mock(CheckstylePluginApi.ConfigurationVisitor.class);
    underTest.visitCurrentConfiguration(visitor);
    ArgumentCaptor<ConfigurationModule> configModuleCaptor = ArgumentCaptor.forClass(ConfigurationModule.class);
    verify(visitor, times(58)).accept(eq("Google Checks"), configModuleCaptor.capture());
    assertThat(configModuleCaptor.getValue(), is(not(nullValue())));
    assertThat(configModuleCaptor.getValue().getName(), is("CommentsIndentation"));
}
Also used : ConfigurationLocationFactory(org.infernus.idea.checkstyle.model.ConfigurationLocationFactory) ConfigurationLocation(org.infernus.idea.checkstyle.model.ConfigurationLocation) BundledConfigurationLocation(org.infernus.idea.checkstyle.model.BundledConfigurationLocation) TreeSet(java.util.TreeSet) BundledConfigurationLocation(org.infernus.idea.checkstyle.model.BundledConfigurationLocation) ConfigurationModule(org.infernus.idea.checkstyle.csapi.ConfigurationModule) Test(org.junit.Test)

Aggregations

TreeSet (java.util.TreeSet)1 ConfigurationModule (org.infernus.idea.checkstyle.csapi.ConfigurationModule)1 BundledConfigurationLocation (org.infernus.idea.checkstyle.model.BundledConfigurationLocation)1 ConfigurationLocation (org.infernus.idea.checkstyle.model.ConfigurationLocation)1 ConfigurationLocationFactory (org.infernus.idea.checkstyle.model.ConfigurationLocationFactory)1 Test (org.junit.Test)1