@Test(expected = ActivityNotFoundException.class) public void launchPointOfSaleThrowsWithNoPointOfSaleInstalled() { chargeActivities.clear(); client.launchPointOfSale(); }
@Override public void launchPointOfSale() { List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePackage.packageName); context.startActivity(pointOfSaleIntent); }
RealPosClient implements PosClient { @Override public void launchPointOfSale() { List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePackage.packageName); context.startActivity(pointOfSaleIntent); } }
RealPosClient implements PosClient { @Override public void launchPointOfSale() { List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePackage.packageName); context.startActivity(pointOfSaleIntent); } RealPosClient(Context context, String clientId); }
RealPosClient implements PosClient { @Override public void launchPointOfSale() { List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePackage.packageName); context.startActivity(pointOfSaleIntent); } RealPosClient(Context context, String clientId); @NonNull @Override Intent createChargeIntent(@NonNull ChargeRequest chargeRequest); @Override boolean isPointOfSaleInstalled(); @Override void launchPointOfSale(); @Override void openPointOfSalePlayStoreListing(); @NonNull @Override ChargeRequest.Success parseChargeSuccess(@NonNull Intent data); @NonNull @Override ChargeRequest.Error parseChargeError(@NonNull Intent data); }
RealPosClient implements PosClient { @Override public void launchPointOfSale() { List<ResolveInfo> activities = queryChargeActivities(); PackageInfo pointOfSalePackage = findPointOfSaleWithHighestVersion(activities); Intent pointOfSaleIntent = packageManager.getLaunchIntentForPackage(pointOfSalePackage.packageName); context.startActivity(pointOfSaleIntent); } RealPosClient(Context context, String clientId); @NonNull @Override Intent createChargeIntent(@NonNull ChargeRequest chargeRequest); @Override boolean isPointOfSaleInstalled(); @Override void launchPointOfSale(); @Override void openPointOfSalePlayStoreListing(); @NonNull @Override ChargeRequest.Success parseChargeSuccess(@NonNull Intent data); @NonNull @Override ChargeRequest.Error parseChargeError(@NonNull Intent data);  }