@Test public void should_delegate_deprovision_to_customerService_deleteCustomerByExternalId() throws HerokuException { service.deprovision("externalId"); verify(customerService).deleteCustomerByExternalId("heroku", "externalId"); }
@Override public void deprovision(String externalId) throws HerokuException { try { customerService.deleteCustomerByExternalId(CustomerService.Source.HEROKU, externalId); } catch (Exception e) { throw new HerokuException("Could not deprovision externalId '" + externalId + "'", e); } }
HerokuServiceImpl implements HerokuService { @Override public void deprovision(String externalId) throws HerokuException { try { customerService.deleteCustomerByExternalId(CustomerService.Source.HEROKU, externalId); } catch (Exception e) { throw new HerokuException("Could not deprovision externalId '" + externalId + "'", e); } } }
HerokuServiceImpl implements HerokuService { @Override public void deprovision(String externalId) throws HerokuException { try { customerService.deleteCustomerByExternalId(CustomerService.Source.HEROKU, externalId); } catch (Exception e) { throw new HerokuException("Could not deprovision externalId '" + externalId + "'", e); } }  }
HerokuServiceImpl implements HerokuService { @Override public void deprovision(String externalId) throws HerokuException { try { customerService.deleteCustomerByExternalId(CustomerService.Source.HEROKU, externalId); } catch (Exception e) { throw new HerokuException("Could not deprovision externalId '" + externalId + "'", e); } }  @Override @Transactional HerokuProvisionResponse provision(HerokuProvisionRequest request); @Override void changePlan(String externalId, HerokuChangePlanRequest request); @Override void deprovision(String externalId); @Override @Transactional @Secured(Roles.ADMIN) String getAccessTokenFor(Long customerId); @Override @Secured(Roles.ADMIN) Instant getAccessTokenExpiresAtFor(Long customerId); @Override String getCallbackUrlFor(Long customerId); }
HerokuServiceImpl implements HerokuService { @Override public void deprovision(String externalId) throws HerokuException { try { customerService.deleteCustomerByExternalId(CustomerService.Source.HEROKU, externalId); } catch (Exception e) { throw new HerokuException("Could not deprovision externalId '" + externalId + "'", e); } }  @Override @Transactional HerokuProvisionResponse provision(HerokuProvisionRequest request); @Override void changePlan(String externalId, HerokuChangePlanRequest request); @Override void deprovision(String externalId); @Override @Transactional @Secured(Roles.ADMIN) String getAccessTokenFor(Long customerId); @Override @Secured(Roles.ADMIN) Instant getAccessTokenExpiresAtFor(Long customerId); @Override String getCallbackUrlFor(Long customerId);  }