File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
dspace-server-webapp/src/test/java/org/dspace/app/rest Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3434import org .dspace .core .Constants ;
3535import org .dspace .eperson .Group ;
3636import org .dspace .services .ConfigurationService ;
37+ import org .junit .After ;
3738import org .junit .Before ;
3839import org .junit .Test ;
3940import org .springframework .beans .factory .annotation .Autowired ;
@@ -58,7 +59,19 @@ public void setup() throws Exception {
5859 // already been created by the time the test method runs.
5960 ReflectionTestUtils .setField (accessStatusService , "helper" , null );
6061 ((AccessStatusServiceImpl ) accessStatusService ).init ();
62+ }
6163
64+ @ After
65+ public void reset () throws Exception {
66+ configurationService .setProperty (
67+ "plugin.single.org.dspace.access.status.AccessStatusHelper" ,
68+ "org.dspace.access.status.DefaultAccessStatusHelper"
69+ );
70+ // This is needed because the AccessStatusHelper is a plugin that is created and set in the
71+ // AccessStatusServiceImpl.init method. AccessStatusService is a spring managed bean, and the context has
72+ // already been created by the time the test method runs.
73+ ReflectionTestUtils .setField (accessStatusService , "helper" , null );
74+ ((AccessStatusServiceImpl ) accessStatusService ).init ();
6275 }
6376
6477 @ Test
You can’t perform that action at this time.
0 commit comments