daily pastebin goal
88%
SHARE
TWEET

Proper line-wrapping samples

a guest Feb 13th, 2018 55 in 24 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 1
  2. // This
  3. List<FinancedDevice> financedDevices = subscriptionProfileQueryResults.getParameters()
  4.     .stream()
  5.     .filter(param -> IMEI_PARAMETER_NAME.equals(param.getName()))
  6.     .map(param -> (String) param.getValue())
  7.     .map(imei -> new FinancedDevice(imei, hasPendingInstallments))
  8.     .collect(Collectors.toList());
  9.  
  10. // Instead of this
  11. List<FinancedDevice> financedDevices = subscriptionProfileQueryResults.getParameters().stream()
  12.     .filter(param -> IMEI_PARAMETER_NAME.equals(param.getName())).map(param -> (String) param.getValue())
  13.     .map(imei -> new FinancedDevice(imei, hasPendingInstallments)).collect(Collectors.toList());
  14.  
  15. // 2
  16. // This
  17. return subscriptionProfileStringRepresentationBuilder
  18.     .append("SubscriptionProfile(")
  19.     .append("accountId=")
  20.     .append(this.getAccountId())
  21.     .append(", subscriptionId=")
  22.     .append(this.getSubscriptionId())
  23.     .append(", subscriptionTypeId=")
  24.     .append(this.getSubscriptionTypeId())
  25.     .append(", financedDevices=")
  26.     .append(this.getFinancedDevices())
  27.     .append(')')
  28.     .toString();
  29.  
  30. // Instead of this
  31. return subscriptionProfileStringRepresentationBuilder.append("SubscriptionProfile(").append("accountId=")
  32.     .append(this.getAccountId()).append(", subscriptionId=").append(this.getSubscriptionId())
  33.     .append(", subscriptionTypeId=").append(this.getSubscriptionTypeId()).append(", financedDevices=")
  34.     .append(this.getFinancedDevices()).append(')').toString();
  35.  
  36. // 3
  37. // This
  38. "<subs2:getSubscriptionProfileResponse xmlns:subs2='http://soap.crmapi.util.redknee.com/subscriptions/xsd/Subscriptions-v2.0'>" +
  39.   "<subs2:return>" +
  40.     "<subs2011:profile xmlns:subs2011='http://soap.crmapi.util.redknee.com/subscriptions/xsd/2011/01'>" +
  41.       "<accountID>" + ACCOUNT_ID + "</accountID>" +
  42.       "<identifier>" + SUBSCRIPTION_ID + "</identifier>" +
  43.       "<subscriptionType>" + SUBSCRIPTION_TYPE_ID + "</subscriptionType>" +
  44.     "</subs2011:profile>" +
  45.     "<parameters>" +
  46.       "<name>" + IMEI_PARAMETER_NAME + "</name>" +
  47.       "<value>" + IMEI + "</value>" +
  48.     "</parameters>" +
  49.   "</subs2:return>" +
  50. "</subs2:getSubscriptionProfileResponse>";
  51.  
  52. // Or even this
  53. "<subs2:getSubscriptionProfileResponse xmlns:subs2='http://soap.crmapi.util.redknee.com/subscriptions/xsd/Subscriptions-v2.0'>\n" +
  54. "  <subs2:return>\n" +
  55. "    <subs2011:profile xmlns:subs2011='http://soap.crmapi.util.redknee.com/subscriptions/xsd/2011/01'>\n" +
  56. "      <accountID>" + ACCOUNT_ID + "</accountID>\n" +
  57. "      <identifier>" + SUBSCRIPTION_ID + "</identifier>\n" +
  58. "      <subscriptionType>" + SUBSCRIPTION_TYPE_ID + "</subscriptionType>\n" +
  59. "    </subs2011:profile>\n" +
  60. "    <parameters>\n" +
  61. "      <name>" + IMEI_PARAMETER_NAME + "</name>\n" +
  62. "      <value>" + IMEI + "</value>\n" +
  63. "    </parameters>\n" +
  64. "  </subs2:return>\n" +
  65. "</subs2:getSubscriptionProfileResponse>\n";
  66.  
  67. // Instead of this
  68. "<subs2:getSubscriptionProfileResponse xmlns:subs2='http://soap.crmapi.util.redknee.com/subscriptions/xsd/Subscriptions-v2.0'>"
  69.     + "<subs2:return>"
  70.     + "<subs2011:profile xmlns:subs2011='http://soap.crmapi.util.redknee.com/subscriptions/xsd/2011/01'>"
  71.     + "<accountID>" + ACCOUNT_ID + "</accountID>" + "<identifier>" + SUBSCRIPTION_ID + "</identifier>"
  72.     + "<subscriptionType>" + SUBSCRIPTION_TYPE_ID + "</subscriptionType>" + "</subs2011:profile>"
  73.     + "<parameters>" + "<name>" + IMEI_PARAMETER_NAME + "</name>" + "<value>" + IMEI + "</value>"
  74.     + "</parameters>" + "</subs2:return>" + "</subs2:getSubscriptionProfileResponse>";
  75.  
  76. // 4
  77. // This
  78. @PrepareForTest({
  79.     GetSubscriptionProfileWorkItemHandler.class,
  80.     BSSService.class,
  81.     WorkItemHaldlerENV.class
  82. })
  83.  
  84. // Instead of this
  85. @PrepareForTest({GetSubscriptionProfileWorkItemHandler.class, BSSService.class, WorkItemHaldlerENV.class})
RAW Paste Data
Top