@Test public void supplyLoan() { LoansourceApplication app = new LoansourceApplication(); Supplier<Loan> loan = app.supplyLoan(); assertNotNull(loan); assertNotNull(loan.get()); assertNotNull(loan.get().getAmount()); assertNotNull(loan.get().getName()); }
@Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("{} {} for ${} for {}", loan.getStatus(), loan.getUuid(), loan.getAmount(), loan.getName()); return loan; }; return loanSupplier; }
LoansourceApplication { @Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("{} {} for ${} for {}", loan.getStatus(), loan.getUuid(), loan.getAmount(), loan.getName()); return loan; }; return loanSupplier; } }
LoansourceApplication { @Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("{} {} for ${} for {}", loan.getStatus(), loan.getUuid(), loan.getAmount(), loan.getName()); return loan; }; return loanSupplier; }  }
LoansourceApplication { @Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("{} {} for ${} for {}", loan.getStatus(), loan.getUuid(), loan.getAmount(), loan.getName()); return loan; }; return loanSupplier; }  static void main(String[] args); @Bean Supplier<Loan> supplyLoan(); }
LoansourceApplication { @Bean public Supplier<Loan> supplyLoan(){ Supplier<Loan> loanSupplier = () -> { Loan loan = new Loan(UUID.randomUUID().toString(), names.get(new Random().nextInt(names.size())), amounts.get(new Random().nextInt(amounts.size()))); log.info("{} {} for ${} for {}", loan.getStatus(), loan.getUuid(), loan.getAmount(), loan.getName()); return loan; }; return loanSupplier; }  static void main(String[] args); @Bean Supplier<Loan> supplyLoan();  }