Ejemplo n.º 1
0
        public async Task Run([TimerTrigger("0 30 5 * * *")] TimerInfo myTimer, ILogger log)
        {
            if (myTimer?.IsPastDue ?? true)
            {
                log.LogTrace("Anonymise data function running late");
            }

            await _anonymiseHearingsConferencesDataService.AnonymiseHearingsConferencesDataAsync().ConfigureAwait(false);

            log.LogInformation("Data anonymised for hearings, conferences older than 3 months.");
        }
Ejemplo n.º 2
0
        public void Should_anonymise_the_old_hearings_and_conferences()
        {
            var usernames = new UserWithClosedConferencesResponse
            {
                Usernames = new List <string> {
                    "*****@*****.**", "*****@*****.**", "*****@*****.**"
                }
            };

            _bookingApiClient.Setup(x => x.GetPersonByClosedHearingsAsync()).ReturnsAsync(usernames);

            _anonymiseHearingsConferencesDataService.AnonymiseHearingsConferencesDataAsync();

            _userApiClient.Verify(x => x.DeleteUserAsync(It.IsAny <string>()), Times.Exactly(3));
            _videoApiClient.Verify(x => x.AnonymiseConferencesAsync(), Times.Once);
            _bookingApiClient.Verify(x => x.AnonymiseHearingsAsync(), Times.Once);
        }