@Test
public void testValidatePackageConfiguration() throws SerializationException {
RepositoryModuleOperations localRepositoryPackageOperations = initSpyingOnRealRepositoryPackageOperations();
Module packageConfigData = createPackageConfigData(true);
ModuleItem packageItem = mock(ModuleItem.class);
initDroolsHeaderCheck(packageItem);
when(packageItem.isArchived()).thenReturn(false);
when(this.rulesRepository.loadModule(packageConfigData.getName())).thenReturn(packageItem);
doNothing().when(localRepositoryPackageOperations).updateCategoryRules(packageConfigData,
packageItem);
doNothing().when(localRepositoryPackageOperations).handleArchivedForSaveModule(packageConfigData,
packageItem);
ServiceSecurity serviceSecurity = mock(ServiceSecurity.class);
DroolsServiceImplementation droolsServiceImplementation = spy(new DroolsServiceImplementation(rulesRepository, serviceSecurity));
initSpyingAndMockingOnSuggestionCompletionLoader(droolsServiceImplementation);
droolsServiceImplementation.validateModule(packageConfigData);
verify(packageItem, never()).updateExternalURI("");
verify(packageItem, never()).updateDescription(packageConfigData.getDescription());
verify(packageItem, never()).archiveItem(packageConfigData.isArchived());
verify(packageItem, never()).checkin(packageConfigData.getDescription());
verify(localRepositoryPackageOperations, never()).handleArchivedForSaveModule(packageConfigData,
packageItem);
}