public void Dispose() { if (_server.IsStarted) { _server.Stop(); } }
private static void StopAndDispose(WireMockServer server) { if (server != null && server.IsStarted) { server.Stop(); } server?.Dispose(); }
protected virtual void Dispose(bool disposing) { if (disposing) { mockServer.Stop(); mockServer.Dispose(); } }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { _server.Stop(); } _disposed = true; }
private static string _hashedAccountId = "LVX89V"; // Account ID 100 static void Main(string[] args) { try { _fakeCommitmentsApi = WireMockServer.Start(new FluentMockServerSettings { Urls = new[] { "http://*:6011" }, StartAdminInterface = true, }); _fakeAccountsApi = WireMockServer.Start(new FluentMockServerSettings { Urls = new[] { "http://*:6012" }, StartAdminInterface = true, }); _fakeCustomerEngagementApi = WireMockServer.Start(new FluentMockServerSettings { Urls = new[] { "http://*:6013" }, StartAdminInterface = true, }); SetupHealthCheckResponse(); SetupApprenticeshipSearchResponses(); SetupGetApprenticeshipResponses(); SetupGetLegalEntityResponse(); SetupGetVendorDetailsResponse(); SetupGetVendorCaseStatusResponse(); Console.WriteLine(("Please RETURN to stop server")); Console.ReadLine(); } finally { _fakeCommitmentsApi.Stop(); _fakeCommitmentsApi.Dispose(); _fakeAccountsApi.Stop(); _fakeAccountsApi.Dispose(); _fakeCustomerEngagementApi.Stop(); _fakeCustomerEngagementApi.Dispose(); } }
protected virtual void Dispose(bool disposing) { if (_isDisposed) { return; } if (disposing) { if (_server != null && _server.IsStarted) { _server.Stop(); } _server?.Dispose(); } _isDisposed = true; }
static void Main(string[] args) { if (args.Contains("--h")) { Console.WriteLine("examples:"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis --h <-- shows this page"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis <-- runs Provider Courses API"); return; } try { _fakeProviderCoursesApi = ProviderCoursesApiBuilder.Create(PortProviderCoursesApi) .WithPing() .WithHasPortableFlexiJobOption(PeterboroughCollege, CourseWithMultipleDeliveryModels) .WithHasPortableFlexiJobOptionFalse(PeterboroughCollege, CourseWithOnlyRegularDeliveryModel) .WithNoCoursesDeliveryModels404(PeterboroughCollege, CourseWithNoDeliveryModelsFound) .Build(); Console.WriteLine(""); Console.WriteLine($"Provider (Peterborough College) : {PeterboroughCollege}"); Console.WriteLine($"Course (Course With Multiple Delivery Models) : {CourseWithMultipleDeliveryModels}"); Console.WriteLine($"Course (Course With Only Regular Delivery Model) : {CourseWithOnlyRegularDeliveryModel}"); Console.WriteLine($"Course (Course With No Delivery Model) : {CourseWithNoDeliveryModelsFound}"); Console.WriteLine(""); Console.WriteLine(("Please RETURN to stop server")); Console.ReadLine(); } finally { _fakeProviderCoursesApi?.Stop(); _fakeProviderCoursesApi?.Dispose(); } }
public void Cleanup() { server.Stop(); }
public void Dispose() { _mockServer.Stop(); }
public static void CleanClass() { stub.Stop(); }
private static void Stop(string why) { Logger.Info("Server stopping because '{why}'", why); Server.Stop(); Logger.Info("Server stopped"); }
public void ShutdownServer() { MockServer?.Stop(); }
public void ShutdownServer() { _server.Stop(); }
public void Dispose() { Server.Stop(); App.StopAsync(TimeSpan.FromSeconds(15)).GetAwaiter().GetResult(); App.Dispose(); }
public void Stop() { _logger.LogInformation("WireMock.Net server stopping"); _server?.Stop(); }
private static void Stop() { _server.Stop(); }
static void Main(string[] args) { if (args.Contains("--h")) { Console.WriteLine("Optional parameters (!inner, !accounts, !commitments, !login, !roatp, !courses) will exclude that fake API"); Console.WriteLine("examples:"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis --h <-- shows this page"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis !inner <-- excludes fake inner api"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis !inner !commitments <-- excludes fake inner and commitments api"); Console.WriteLine("SFA.DAS.ApprenticeCommitments.MockApis !login !roatp <-- excludes fake login and roatp api"); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Currently supported values"); Console.WriteLine($"EmployerAccountId : {EmployerAccountId}"); Console.WriteLine($"ApprenticeshipId : {ApprenticeshipId}"); Console.WriteLine($"TrainingProviderId : {TrainingProviderId}"); return; } try { if (!args.Contains("!inner", StringComparer.CurrentCultureIgnoreCase)) { _fakeInnerApi = ApprenticeCommitmentsInnerApiBuilder.Create(PortInnerApi) .WithPing() .WithAnyNewApprenticeship() .WithRegistrationReminders() .WithReminderSent() .WithRegistrationSeen() .WithExistingApprenticeship() .WithHowApprenticeshipWillBeDelivered() .Build(); } if (!args.Contains("!accounts", StringComparer.CurrentCultureIgnoreCase)) { _fakeInnerApi = ApprenticeAccountsApiBuilder.Create(PortAccountsApi) .WithPing() .WithAnyApprentice() .Build(); } if (!args.Contains("!commitments", StringComparer.CurrentCultureIgnoreCase)) { _fakeCommitmentsV2Api = CommitmentsV2ApiBuilder.Create(PortCommitmentsApi) .WithPing() .WithAValidApprentice(EmployerAccountId, ApprenticeshipId, CourseId) //.WithAnyApprenticeship() .Build(); } if (!args.Contains("!login", StringComparer.CurrentCultureIgnoreCase)) { _fakeApprenticeLoginApi = ApprenticeLoginApiBuilder.Create(PortLoginApi) .WithPing() .WithAnyInvitation() .Build(); } if (!args.Contains("!roatp", StringComparer.CurrentCultureIgnoreCase)) { _fakeTrainingProviderApi = TrainingProviderApiBuilder.Create(PortRoatpApi) .WithPing() .WithValidSearch(TrainingProviderId) .Build(); } if (!args.Contains("!courses", StringComparer.CurrentCultureIgnoreCase)) { _fakeCoursesApi = CoursesApiBuilder.Create(PortCoursesApi) .WithPing() .WithCourses(CourseId) .WithCoursesForStandardUIds() .Build(); } Console.WriteLine(("Please RETURN to stop server")); Console.ReadLine(); } finally { _fakeInnerApi?.Stop(); _fakeInnerApi?.Dispose(); _fakeCommitmentsV2Api?.Stop(); _fakeCommitmentsV2Api?.Dispose(); _fakeApprenticeLoginApi?.Stop(); _fakeApprenticeLoginApi?.Dispose(); _fakeTrainingProviderApi?.Stop(); _fakeTrainingProviderApi?.Dispose(); _fakeCoursesApi?.Stop(); _fakeCoursesApi?.Dispose(); } }
public static void Cleanup() { _wireMockServer.Stop(); }
public void Stop(WireMockServer wireMockServer) { wireMockServer.Stop(); }
public static void StopServer() { StubServer.Stop(); }
private static void Stop(string why) { Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'"); _server.Stop(); Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped"); }
public void Dispose() { _server?.Stop(); _server?.Dispose(); _httpClient?.Dispose(); }
public void Dispose() { stub.Stop(); }
public static void TearDown() { stub.Stop(); }
private static void Stop(string why) { Logger.LogInformation("WireMock.Net server stopping because '{why}'", why); Server.Stop(); Logger.LogInformation("WireMock.Net server stopped"); }
public void Dispose() { Server.Stop(); }
public void Dispose() { _cts.Cancel(); _mockServer.Stop(); _mockServer.Dispose(); }
public void Dispose() { _server?.Stop(); _server?.Dispose(); }
public void Stop() { Stub.Stop(); }