Added a method to clear controller in cas

This commit is contained in:
Raf Ponsaerts
2019-09-26 10:54:10 +02:00
parent 1392b62d83
commit 017ba13710
3 changed files with 13 additions and 1 deletions

View File

@@ -220,6 +220,9 @@ public final class ChoiceAuthorityServiceImpl implements ChoiceAuthorityService
return controller;
}
public void clearController() {
controller.clear();
}
private void loadChoiceAuthorityConfigurations() {
// Get all configuration keys starting with a given prefix
List<String> propKeys = configurationService.getPropertyKeys(CHOICES_PLUGIN_PREFIX);

View File

@@ -168,4 +168,6 @@ public interface ChoiceAuthorityService {
public ChoiceAuthority getChoiceAuthorityByAuthorityName(String authorityName);
public void clearController();
}

View File

@@ -19,6 +19,7 @@ import org.apache.solr.client.solrj.response.QueryResponse;
import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
import org.dspace.authority.PersonAuthorityValue;
import org.dspace.authority.factory.AuthorityServiceFactory;
import org.dspace.content.authority.service.ChoiceAuthorityService;
import org.dspace.core.service.PluginService;
import org.dspace.services.ConfigurationService;
import org.hamcrest.Matchers;
@@ -35,6 +36,9 @@ public class AuthorityRestRepositoryIT extends AbstractControllerIntegrationTest
@Autowired
private PluginService pluginService;
@Autowired
private ChoiceAuthorityService cas;
@Before
public void setup() throws Exception {
super.setUp();
@@ -53,8 +57,11 @@ public class AuthorityRestRepositoryIT extends AbstractControllerIntegrationTest
configurationService.setProperty("authority.author.indexer.field.1",
"dc.contributor.author");
//TODO Comments
pluginService.clearNamedPluginClasses();
cas.clearController();
PersonAuthorityValue person1 = new PersonAuthorityValue();
person1.setId(String.valueOf(UUID.randomUUID()));
person1.setLastName("Shirasaka");