@Test public void oneException() throws Exception { assertThrows(BusinessException.class, () -> { new FindCustomer("123", new BusinessException("test")).perform(); }); }
@Override public String perform() throws BusinessException { if (!this.errors.isEmpty()) { throw this.errors.pop(); } return this.customerId; }
FindCustomer implements BusinessOperation<String> { @Override public String perform() throws BusinessException { if (!this.errors.isEmpty()) { throw this.errors.pop(); } return this.customerId; } }
FindCustomer implements BusinessOperation<String> { @Override public String perform() throws BusinessException { if (!this.errors.isEmpty()) { throw this.errors.pop(); } return this.customerId; } FindCustomer(String customerId, BusinessException... errors); }
FindCustomer implements BusinessOperation<String> { @Override public String perform() throws BusinessException { if (!this.errors.isEmpty()) { throw this.errors.pop(); } return this.customerId; } FindCustomer(String customerId, BusinessException... errors); @Override String perform(); }
FindCustomer implements BusinessOperation<String> { @Override public String perform() throws BusinessException { if (!this.errors.isEmpty()) { throw this.errors.pop(); } return this.customerId; } FindCustomer(String customerId, BusinessException... errors); @Override String perform();  }