Skip to content

Commit

Permalink
test: add ApplicationContext for LockRespository
Browse files Browse the repository at this point in the history
  • Loading branch information
Rwolfe-Nava committed Oct 3, 2023
1 parent ffbd437 commit b51080b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/
public class CoverageLockWrapper {

@Autowired
ApplicationContext context;

private static final String COVERAGE_LOCK_NAME = "COVERAGE_LOCK";
private static final int TEN_MINUTES_IN_MILLIS = 600_000;

Expand All @@ -44,7 +47,9 @@ public LockRepository contractLockRepository() {
// What this means is that if you are locking longer than this TTL, then
// you need to renew the lock otherwise you will lose it and get undefined
// behavior when you attempt to unlock your lock.
defaultLockRepository.setApplicationContext(context);
defaultLockRepository.setTimeToLive(TEN_MINUTES_IN_MILLIS);
defaultLockRepository.afterSingletonsInstantiated();
defaultLockRepository.afterPropertiesSet();
return defaultLockRepository;
}
Expand Down

0 comments on commit b51080b

Please sign in to comment.