All authors

Claude Skills by HoangNguyen0403
github.com/HoangNguyen04031,434 skills30 installs1,975 views
- Spring Boot Data AccessUse Flyway or Liquibase for versioned, reviewable migrations. Keep each migration immutable and apply it as part of deployment before code that depends on the new schema. For example, with Flyway add the Spring Boot Flyway integration and place migrations under `db/migration` using names such as `V1__create_orders.sql` and `V2__add_status.sql`. Keep schema ownership and migration history with the service. Do not use `spring.jpa.hibernate.ddl-auto=create` in production; it can destroy or recre...Votes: 0GitHub stars: 549
- Spring Boot Data AccessSpring Boot uses HikariCP by default in the usual JDBC setup. Configure an explicit pool limit and timeouts in `application.yaml`, for example: ```yaml spring: datasource: url: ${DB_URL} username: ${DB_USERNAME} password: ${DB_PASSWORD} hikari: maximum-pool-size: 20 minimum-idle: 5 connection-timeout: 30000 max-lifetime: 1800000 pool-name: app-pool ``` Choose `maximum-pool-size` from measured database capacity and expected concurrent queries, not from the number of application threads or pods...Votes: 0GitHub stars: 549
- Spring Boot Deployment./gradlew bootBuildImage ``` These tools produce a layered, cache-friendly image. If a custom Dockerfile is required, build a layered JAR in one stage and copy its dependency, loader, and application layers into a small runtime stage. Use an `eclipse-temurin` or distroless runtime, run as a non-root `appuser`, and copy only the runtime artifacts. Do not use a root container or put credentials in build arguments or image layers. Keep the layers ordered so infrequently changing dependencies are...Votes: 0GitHub stars: 549
- Spring Boot DeploymentAdd Spring Boot Actuator and expose health groups for Kubernetes probes. Configure liveness and readiness separately so a dependency outage does not necessarily make the process liveness-fail: ```yaml management: endpoint: health: probes: enabled: true endpoints: web: exposure: include: health,info,prometheus ``` Kubernetes can then use `/actuator/health/liveness` and `/actuator/health/readiness` as HTTP probes. Liveness should answer “can this process recover without a restart?”; readiness s...Votes: 0GitHub stars: 549
- Spring Boot DeploymentKeep secrets outside the application artifact and image. Inject them at runtime through Kubernetes Secrets, a managed secret store such as Vault, or environment variables; `spring.config.import` can integrate an external configuration source. Reference values from configuration instead of committing them: ```yaml datasource: password: ${DB_PASSWORD} ``` Do not put credentials in `application-prod.yml`, Dockerfiles, Docker build arguments, Git history, or image layers. Restrict Secret access w...Votes: 0GitHub stars: 549
- Spring Boot MicroservicesFor synchronous Spring Boot service calls, use Spring Cloud OpenFeign or Spring 6 HTTP Interfaces and wrap the call with Resilience4j. The minimum resilience policy should include a circuit breaker, bounded retries with exponential backoff, and a rate limiter. Set connect/read/request timeouts as well; retries without a timeout can amplify an outage. ```java @FeignClient(name = "inventory", fallbackFactory = InventoryFallback.class) interface InventoryClient { @GetMapping("/api/v1/items/{id}"...Votes: 0GitHub stars: 549
- Spring Boot MicroservicesUse synchronous REST calls when the caller needs an immediate response, through Spring Cloud OpenFeign or Spring 6 HTTP Interfaces. Keep the contract in versioned DTO records or a dedicated API contract module, add timeouts and Resilience4j circuit breaker/retry/rate-limiter policies, and propagate Micrometer tracing context. Use asynchronous messaging when work can be decoupled or retried independently. Spring Cloud Stream lets handlers be declared as `Consumer`, `Function`, or `Supplier`; s...Votes: 0GitHub stars: 549
- Spring Boot MicroservicesUse Micrometer Tracing with the OpenTelemetry bridge rather than creating trace IDs manually. Add the tracing and metrics dependencies, for example `micrometer-tracing-bridge-otel`, configure the exporter/propagation in `application.yaml`, and ensure the context travels through HTTP clients, message handlers, and `@Async` execution. Every log line should carry the trace/span correlation fields. Use SLF4J and structured JSON logging in production; if you add request metadata to MDC, clear it i...Votes: 0GitHub stars: 549
- Spring Boot ObservabilityUse SLF4J, typically via `@Slf4j`, and emit structured logs to stdout. In production, configure a JSON encoder such as `logstash-logback-encoder` so the platform can parse fields without scraping prose: ```java log.info("order created orderId={} customerId={}", orderId, customerId); ``` Keep sensitive values out of logs and use stable field names. Add request and trace correlation through MDC, including fields such as trace ID, span ID, user ID, or tenant ID where appropriate. MDC is thread-l...Votes: 0GitHub stars: 549
- Spring Boot ObservabilityAdd Spring Boot Actuator and the Prometheus registry, then expose the Prometheus endpoint deliberately: ```yaml management: endpoints: web: exposure: include: health,info,prometheus ``` Scrape `/actuator/prometheus` from the metrics system and verify it with: ```bash curl http://localhost:8080/actuator/prometheus ``` Do not expose all Actuator endpoints indiscriminately. Secure `/actuator/**` with an administrative role or isolate the management port/network path, while allowing only the heal...Votes: 0GitHub stars: 549
- Spring Boot ObservabilityUse Micrometer Tracing with the OpenTelemetry bridge (`micrometer-tracing-bridge-otel`) and configure the exporter and propagation in `application.yaml`. The trace context must be preserved across inbound requests, outbound clients, message handlers, and `@Async` work; do not generate unrelated IDs by hand. Use structured JSON logs and include trace/span correlation fields. If request metadata is placed in MDC, clear it in a `finally` block. Log to stdout and let the runtime aggregate it. Exp...Votes: 0GitHub stars: 549
- Spring Boot SchedulingEnable scheduling and configure a dedicated `TaskScheduler`; Spring's default scheduler has only one thread and can serialize unrelated jobs: ```java @Configuration @EnableScheduling class SchedulingConfig { @Bean TaskScheduler taskScheduler() { var scheduler = new ThreadPoolTaskScheduler(); scheduler.setPoolSize(8); scheduler.setThreadNamePrefix("scheduled-"); scheduler.initialize(); return scheduler; } } ``` Keep each `@Scheduled` method small and idempotent. Offload long work to `@Async` o...Votes: 0GitHub stars: 549
- Spring Boot Scheduling`@Scheduled` executes in every application instance. In Kubernetes, that means a three-pod deployment can run the same job three times. Use ShedLock backed by a shared database or other supported store: ```java @Scheduled(cron = "0 */5 * * * *") @SchedulerLock(name = "reconcileOrders", lockAtMostFor = "4m", lockAtLeastFor = "30s") void reconcileOrders() { ... } ``` Enable ShedLock for scheduled tasks and choose `lockAtMostFor` longer than the normal maximum runtime, but finite so a crashed po...Votes: 0GitHub stars: 549
- Spring Boot SchedulingTreat a scheduled task as restartable and idempotent. Keep the `@Scheduled` method light, hand long-running work to `@Async` or a durable queue, and configure a dedicated `TaskScheduler` rather than relying on the default one-thread pool. Wrap the boundary in explicit failure handling: ```java @Scheduled(fixedDelayString = "${jobs.reconcile-delay}") void run() { try { reconcile(); } catch (TransientException ex) { log.warn("reconcile failed; retry will be attempted", ex); throw ex; } catch (E...Votes: 0GitHub stars: 549
- Spring Boot SecurityExpose a `SecurityFilterChain` bean using the Spring Security 6 Lambda DSL; do not extend the removed `WebSecurityConfigurerAdapter`: ```java @Bean SecurityFilterChain api(HttpSecurity http) throws Exception { http .csrf(csrf -> csrf.disable()) // only for a pure token-based API .cors(Customizer.withDefaults()) .sessionManagement(s -> s.sessionCreationPolicy(STATELESS)) .authorizeHttpRequests(auth -> auth .requestMatchers("/actuator/health", "/v3/api-docs/**").permitAll() .requestMatchers("/a...Votes: 0GitHub stars: 549
- Spring Boot SecurityConfigure a resource server with a `JwtDecoder` (or an `AuthenticationManager`) and keep the filter chain stateless. Use the Spring Security 6 Lambda DSL and authorize with `requestMatchers` and method-level `@PreAuthorize`; do not use the legacy adapter or `.and()` style. Validate more than the JWT signature. Permit only an expected signing algorithm (RS256 or HS256), reject `none`, and validate `iss`, `aud`, and `exp`. Keep access tokens short-lived (about 15 minutes is a common policy). If...Votes: 0GitHub stars: 549
- Spring Boot SecurityApply hardening at the filter, token, browser, operations, and dependency layers: - Define a `SecurityFilterChain` bean with the Spring Security 6 Lambda DSL and `requestMatchers`; do not use `WebSecurityConfigurerAdapter`, `.and()`, or `antMatchers`. - Use stateless sessions for bearer-token REST APIs. Validate JWT signature, permitted algorithm (RS256/HS256), issuer, audience, and expiry; reject `none`. - Separate authentication from authorization and enforce roles/scopes with `@PreAuthoriz...Votes: 0GitHub stars: 549
- Spring Boot TestingUse a real database in an integration test through Testcontainers rather than substituting H2 for a production database with different SQL and transaction behavior. Start the container for the same engine/version family as production, provide its connection properties to Spring, and run the test against the real repository and migration path. ```java @SpringBootTest @Testcontainers class OrderRepositoryIT { @Container static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgre...Votes: 0GitHub stars: 549
- Spring Boot TestingUse a focused `@WebMvcTest` for a controller slice. It loads MVC infrastructure and the controller, while downstream services are mocked: ```java @WebMvcTest(OrderController.class) class OrderControllerTest { @Autowired MockMvc mvc; @MockBean OrderService service; @Test void returnsBadRequestWhenRequestIsInvalid() throws Exception { mvc.perform(post("/api/v1/orders") .contentType(MediaType.APPLICATION_JSON) .content("{}")) .andExpect(status().isBadRequest()); } } ``` Use `@Valid` on controlle...Votes: 0GitHub stars: 549
- Spring Boot TestingKeep the service test isolated from the network. Inject a client abstraction, mock it for unit tests, and use WireMock for an integration-style HTTP contract test. This lets the test exercise serialization, status handling, timeouts, and retry behavior without depending on a live third-party service. ```java @ExtendWith(MockitoExtension.class) class PaymentServiceTest { @Mock PaymentClient client; @InjectMocks PaymentService service; @Test void mapsClientFailureToDomainFailure() { when(client...Votes: 0GitHub stars: 549
- Swift Best PracticesUse `guard` when a condition must hold for the rest of the function. Its `else` block must exit the current scope: ```swift func displayName(for user: User?) -> String { guard let user else { return "Anonymous" } guard !user.name.isEmpty else { return "Unnamed" } return user.name } ``` This keeps the happy path unindented and makes precondition failures explicit. Prefer it to deeply nested `if let` statements; use `if let` when the optional value is needed only in a small branch.Votes: 0GitHub stars: 549
- Swift Best PracticesDefault to a `struct` when the value has value semantics and does not need shared identity or inheritance: ```swift struct User { let id: UUID let name: String } ``` Use a `class` when instances must have shared reference identity, participate in an object lifecycle, or use inheritance. Make non-subclassable classes `final`, and prefer `let` properties unless mutation is required. Structs are generally easier to reason about and safer to share across concurrent code.Votes: 0GitHub stars: 549
- Swift Best PracticesPrefer clear, idiomatic Swift patterns: - Use `guard` for preconditions and early exits rather than nesting the happy path. - Default to `let`, structs, and `final` classes; use mutation, reference types, and inheritance only when needed. - Follow Swift API Design Guidelines with descriptive camelCase names and `PascalCase` type names. - Prefix Boolean properties with `is`, `has`, or `can`, such as `isValid` or `canEdit`. - Use `compactMap`, `filter`, and `reduce` for collection transformatio...Votes: 0GitHub stars: 549
- Swift Best PracticesName Boolean properties as questions or capabilities, usually with `is`, `has`, or `can`: ```swift struct Account { let isVerified: Bool let hasPremiumAccess: Bool let canDelete: Bool } ``` This makes call sites read naturally (`if account.isVerified`). Follow Swift API Design Guidelines and use camelCase for properties.Votes: 0GitHub stars: 549
- Swift ConcurrencySwift’s concurrency model uses `async` to mark asynchronous functions and `await` when calling them. ```swift func fetchUsername() async throws -> String { let (data, _) = try await URLSession.shared.data( from: URL(string: "https://example.com/user")! ) return String(decoding: data, as: UTF8.self) } func loadUser() { Task { do { let username = try await fetchUsername() print(username) } catch is CancellationError { print("Operation cancelled") } catch { print("Request failed:", error) } } } ...Votes: 0GitHub stars: 549
- Swift ConcurrencyUse an `actor` to isolate shared mutable state. Actor-isolated methods and properties are accessed asynchronously with `await`, preventing data races. ```swift actor Counter { private var value = 0 func increment() { value += 1 } func currentValue() -> Int { value } nonisolated func description() -> String { "Thread-safe counter" } } let counter = Counter() Task { await counter.increment() let value = await counter.currentValue() print(value) } ``` Key practices: - Mark asynchronous functions...Votes: 0GitHub stars: 549
- Swift ConcurrencyAnnotate UI types or members with `@MainActor`: ```swift @MainActor final class ProfileViewModel: ObservableObject { @Published var name = "" func load() async { let profile = await fetchProfile() name = profile.name } nonisolated func makeRequestID() -> UUID { UUID() } } ``` For SwiftUI views: ```swift @MainActor struct ProfileView: View { @StateObject private var viewModel = ProfileViewModel() var body: some View { Text(viewModel.name) .task { await viewModel.load() } } } ``` Use `@MainActo...Votes: 0GitHub stars: 549
- Swift ConcurrencyUse `async let` when multiple independent async operations can run concurrently: ```swift struct Dashboard { let profile: Profile let notifications: [Notification] } func loadDashboard() async throws -> Dashboard { async let profile = fetchProfile() async let notifications = fetchNotifications() // Await results when they are needed. return try await Dashboard( profile: profile, notifications: notifications ) } ``` The two fetches start in parallel. `async let` values are automatically awaite...Votes: 0GitHub stars: 549
- Swift ConcurrencyUse `withTaskGroup` for a dynamic number of child tasks. The closure is `async`, and results are consumed with `for await`: ```swift func fetchAll(ids: [Int]) async -> [String] { await withTaskGroup(of: String?.self, returning: [String].self) { group in for id in ids { group.addTask { try? await fetchName(for: id) } } var names: [String] = [] for await name in group { if let name { names.append(name) } } return names } } ``` For operations that can fail, use `withThrowingTaskGroup` and handle...Votes: 0GitHub stars: 549
- Swift Error HandlingUse typed errors, mark recoverable failures with `throws`, and handle them with specific `do-catch` clauses: ```swift enum LoginError: Error { case invalidCredentials, lockedOut } func login() throws -> Session { guard credentialsAreValid else { throw LoginError.invalidCredentials } return Session() } do { let session = try login() show(session) } catch LoginError.invalidCredentials { showMessage("Check your credentials") } catch { showMessage("Could not sign in") } ``` Propagate errors with ...Votes: 0GitHub stars: 549
- Swift Error HandlingDefine domain-specific errors as an `enum` conforming to `Error`, adding associated values when callers need context: ```swift enum FileError: Error { case missing(URL) case unreadable(reason: String) } func read(_ url: URL) throws -> Data { guard FileManager.default.fileExists(atPath: url.path) else { throw FileError.missing(url) } return try Data(contentsOf: url) } ``` Mark the operation `throws`, then handle specific cases in `do-catch`. Avoid untyped `Error(message:)`; a typed error hiera...Votes: 0GitHub stars: 549
- Swift Error HandlingUse `throws` for normal synchronous or `async throws` APIs where the caller can handle failure immediately through `do-catch`: ```swift func load() throws -> Model { ... } do { let model = try load() } catch { handle(error) } ``` Use `Result<Success, Failure>` for callback-based APIs, stored/deferred outcomes, or functional transformations with `.map()` and `.flatMap()`: ```swift func load(completion: (Result<Model, Error>) -> Void) { ... } ``` Call `.get()` to convert a `Result` back into a ...Votes: 0GitHub stars: 549
- Swift Error HandlingUse `fatalError` only for an unrecoverable programmer error or an invariant that should be unreachable, such as a required implementation that is intentionally absent. It is not appropriate for expected input, network, or user errors. ```swift func makeRequiredService() -> Service { fatalError("Service must be provided by dependency injection") } ``` Prefer typed `throws` for recoverable failures, and `precondition`, `assert`, or `assertionFailure` when expressing programmer assumptions. Keep...Votes: 0GitHub stars: 549
- Swift LanguageUse safe optional handling instead of force unwrapping: ```swift func title(for item: Item?) -> String { guard let item else { return "Untitled" } return item.title } let displayTitle = item?.title ?? "Untitled" if let item { print(item.title) } ``` Use `guard let` when the value is needed for the remainder of the scope, `if let` for a local branch, and `??` for a default. Avoid `Type!`, `!`, and `as!`; use proper optionals and conditional casts (`as?`).Votes: 0GitHub stars: 549
- Swift LanguageProtocols define a behavioral contract and support composition; class inheritance reuses implementation through a reference-type hierarchy. ```swift protocol Payable { func pay() } struct Invoice: Payable { func pay() { /* ... */ } } class BaseController { } final class CheckoutController: BaseController { } ``` Prefer protocol composition and structs for decoupling and value semantics. Use class inheritance when shared reference identity or inherited implementation is genuinely required, and...Votes: 0GitHub stars: 549
- Swift LanguageDeclare protocol conformance in an extension to separate the type's main definition from the conformance implementation: ```swift struct User { let id: UUID } protocol IdentifiableUser { var id: UUID { get } } extension User: IdentifiableUser { // All required members are implemented here or in the main type. } ``` Extensions can add computed properties, methods, and conformance, but cannot add stored properties. Implement every required protocol member explicitly so the protocol witness is c...Votes: 0GitHub stars: 549
- Swift LanguageUse an enum with associated values when each case carries different typed data: ```swift enum LoadState { case idle case loading case success(User) case failure(Error) } func render(_ state: LoadState) { switch state { case .idle: show("Idle") case .loading: show("Loading") case .success(let user): show(user.name) case .failure(let error): show(error.localizedDescription) } } ``` This is safer than representing mutually exclusive states with several optionals. Use an exhaustive `switch` and e...Votes: 0GitHub stars: 549
- Swift LanguagePrefer a `struct` for a value type with independent copies and no need for identity or inheritance: ```swift struct Point { var x: Double; var y: Double } ``` Use a `class` when instances must be shared by reference, have identity or lifecycle semantics, or require inheritance: ```swift final class Session { var token: String; init(token: String) { self.token = token } } ``` Structs are copied on assignment; class instances are shared. Keep properties immutable with `let` when possible and ma...Votes: 0GitHub stars: 549
- Swift Memory ManagementTo avoid a retain cycle in Swift: - Use `weak` when a reference can become `nil`, such as delegates or optional parent references. - Use `unowned` only when the referenced object is guaranteed to outlive the referring object; otherwise prefer `weak`. - For escaping closures, put `[weak self]` at the beginning of the closure’s capture list: ```swift class ViewModel { var onUpdate: (() -> Void)? func configure() { onUpdate = { [weak self] in guard let self else { return } self.refresh() } } fun...Votes: 0GitHub stars: 549
- Swift Memory ManagementUse `weak` when the reference may become `nil` while the referring object exists. It is optional and safe: ```swift protocol MyDelegate: AnyObject {} weak var delegate: MyDelegate? ``` Use `unowned` only when the referenced object is guaranteed to outlive the referring object. It is non-optional, but accessing it after deallocation crashes. This is rare; prefer `weak` unless the lifetime guarantee is certain. For escaping closures that could create a retain cycle, put the capture at the begin...Votes: 0GitHub stars: 549
- Swift Memory ManagementUse `[weak self]` at the beginning of the closure’s capture list: ```swift someAsyncOperation { [weak self] result in guard let self = self else { return } self.handle(result) } ``` This prevents a retain cycle. Since `self` may become `nil`, you can also use optional chaining: ```swift someAsyncOperation { [weak self] result in self?.handle(result) } ``` Use `weak` if the reference can become nil. Use `unowned` only if `self` is guaranteed to outlive the closure; otherwise, `unowned` can cra...Votes: 0GitHub stars: 549
- Swift Memory ManagementUse a class-bound delegate protocol and make the delegate reference `weak`: ```swift protocol MyDelegate: AnyObject { func didFinish() } final class Worker { weak var delegate: MyDelegate? func finish() { delegate?.didFinish() } } ``` Because the delegate reference is weak, `Worker` does not retain its delegate, preventing a retain cycle. Use `weak` when the delegate can become `nil`; use `unowned` only if the delegate is guaranteed to outlive the referring object. For closures stored as prop...Votes: 0GitHub stars: 549
- Swift SwiftuiUse `@State` when the view owns and manages the data, such as a toggle or text input. Keep it `private`. ```swift struct SettingsView: View { @State private var isEnabled = false var body: some View { Toggle("Enabled", isOn: $isEnabled) } } ``` Use `@Binding` when data is owned by a parent but passed down to a child that needs two-way access. ```swift struct ParentView: View { @State private var isEnabled = false var body: some View { SettingsRow(isEnabled: $isEnabled) } } struct SettingsRow:...Votes: 0GitHub stars: 549
- Swift Swiftui`@StateObject` is for an `ObservableObject` created and owned by the view. SwiftUI preserves its instance across view updates and manages its lifecycle. ```swift struct ParentView: View { @StateObject private var model = MyModel() } ``` `@ObservedObject` is for an `ObservableObject` received from an external source, such as a parent. The view observes it but does not own its lifecycle. ```swift struct ChildView: View { @ObservedObject var model: MyModel } ``` Use `@StateObject` for owned data...Votes: 0GitHub stars: 549
- Swift SwiftuiUse an `ObservableObject` owned by the root view, then inject it into the view hierarchy with `.environmentObject()`: ```swift final class AppModel: ObservableObject { @Published var username = "" } struct RootView: View { @StateObject private var model = AppModel() // View owns lifecycle var body: some View { VStack { ChildView() } .environmentObject(model) // Inject into the hierarchy } } struct ChildView: View { @EnvironmentObject private var model: AppModel var body: some View { TextField...Votes: 0GitHub stars: 549
- Swift SwiftuiUse `LazyVStack` inside a `ScrollView` when displaying a large number of views. It creates rows lazily, loading them only as they appear: ```swift struct ItemList: View { let items: [Item] var body: some View { ScrollView { LazyVStack(alignment: .leading, spacing: 12) { ForEach(items) { item in ItemRow(item: item) } } .padding() } } } ``` For best performance: - Keep each row lightweight. - Avoid heavy computation in `body`; perform async work with `@State` and `.task()`. - Use stable `Identi...Votes: 0GitHub stars: 549
- Swift TestingWrite unit tests as `XCTestCase` methods whose names start with `test`, use specific assertions, and isolate dependencies with protocols or injected fakes: ```swift final class UserServiceTests: XCTestCase { func testFetchReturnsUser() throws { let service = UserService(client: StubClient(user: User(name: "Ava"))) let user = try service.fetch() XCTAssertEqual(user.name, "Ava") } } ``` Use `setUpWithError()` and `tearDownWithError()` for shared environment setup, keep tests focused on behavior...Votes: 0GitHub stars: 549
- Swift TestingMark an XCTest method `async throws` and call the asynchronous API with `try await` directly: ```swift final class APIClientTests: XCTestCase { func testFetchUser() async throws { let client = APIClient(transport: StubTransport()) let user = try await client.fetchUser() XCTAssertEqual(user.id, 42) } } ``` Use structured async APIs rather than `Thread.sleep`. If the code is callback-based, bridge or test it with an `XCTestExpectation` and a reasonable timeout.Votes: 0GitHub stars: 549
- Swift TestingCreate an expectation before starting callback-based work, fulfill it in the completion handler, then wait with a finite timeout: ```swift func testCompletionIsCalled() { let expectation = expectation(description: "completion called") client.fetch { result in XCTAssertEqual(try? result.get().id, 42) expectation.fulfill() } wait(for: [expectation], timeout: 2.0) } ``` Use `async throws` tests with `try await` for async APIs instead of blocking. Every expectation needs a reasonable timeout so a...Votes: 0GitHub stars: 549
- Swift TestingDepend on a protocol and inject a stub or mock through the initializer: ```swift protocol UserStore { func user() throws -> User } final class StubUserStore: UserStore { let value: User init(value: User) { self.value = value } func user() throws -> User { value } } final class ProfileViewModel { private let store: UserStore init(store: UserStore) { self.store = store } } ``` Tests can now supply deterministic success and failure stores without networking or global state. Keep mocks focused on...Votes: 0GitHub stars: 549