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"));
}
Aggregations