@Test public void openReturnsAutoSavingWallet() { // Arrange: final TestContext context = new TestContext(); // Act: final Wallet wallet = context.walletServices.open(context.pair); wallet.addOtherAccount(new WalletAccount()); // Assert: Mockito.verify(context.repository, Mockito.times(1)) .save(context.descriptor, context.originalWallet); }
@Test public void createReturnsAutoSavingWallet() { // Arrange: final TestContext context = new TestContext(); // Act: final Wallet wallet = context.walletServices.create(context.pair); wallet.addOtherAccount(new WalletAccount()); // Assert: // TODO BR: Fix this // Mockito.verify(context.repository, Mockito.times(2)).save(context.descriptor, wallet); Mockito.verify(context.repository, Mockito.times(2)).save(Mockito.any(), Mockito.any()); }