com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. -------------------------------------------------------------------------------
  2. Test set: com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest
  3. -------------------------------------------------------------------------------
  4. Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.046 s <<< FAILURE! - in com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest
  5. resolveShipType_deliveryMethod3_requiresExplicitShipType Time elapsed: 0 s <<< ERROR!
  6. java.lang.NullPointerException
  7. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  8. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.resolveShipType_deliveryMethod3_requiresExplicitShipType(ProductOrderServiceFulfillmentMultiModeTest.java:247)
  9. ship_local_syncsWechatWithLogisticsType2 Time elapsed: 0.031 s <<< ERROR!
  10. org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
  11. Misplaced or misused argument matcher detected here:
  12. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  13. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  14. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  15. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  16. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  17. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  18. You cannot use argument matchers outside of verification or stubbing.
  19. Examples of correct usage of argument matchers:
  20. when(mock.get(anyInt())).thenReturn(null);
  21. doThrow(new RuntimeException()).when(mock).someVoidMethod(any());
  22. verify(mock).someMethod(contains("foo"))
  23. This message may appear after an NullPointerException if the last matcher is returning an object
  24. like any() but the stubbed method signature expect a primitive argument, in this case,
  25. use primitive alternatives.
  26. when(mock.get(any())); // bad use, will raise NPE
  27. when(mock.get(anyInt())); // correct usage use
  28. Also, this error might show up because you use argument matchers with methods that cannot be mocked.
  29. Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
  30. Mocking methods declared on non-public parent classes is not supported.
  31. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.setUp(ProductOrderServiceFulfillmentMultiModeTest.java:37)
  32. ship_express_requiresTrackingAndCompany Time elapsed: 0.004 s <<< ERROR!
  33. java.lang.NullPointerException
  34. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  35. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.ship_express_requiresTrackingAndCompany(ProductOrderServiceFulfillmentMultiModeTest.java:85)
  36. ship_selfPickup_syncsWechatWithLogisticsType4 Time elapsed: 0.001 s <<< ERROR!
  37. org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
  38. Misplaced or misused argument matcher detected here:
  39. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  40. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  41. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  42. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  43. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  44. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  45. You cannot use argument matchers outside of verification or stubbing.
  46. Examples of correct usage of argument matchers:
  47. when(mock.get(anyInt())).thenReturn(null);
  48. doThrow(new RuntimeException()).when(mock).someVoidMethod(any());
  49. verify(mock).someMethod(contains("foo"))
  50. This message may appear after an NullPointerException if the last matcher is returning an object
  51. like any() but the stubbed method signature expect a primitive argument, in this case,
  52. use primitive alternatives.
  53. when(mock.get(any())); // bad use, will raise NPE
  54. when(mock.get(anyInt())); // correct usage use
  55. Also, this error might show up because you use argument matchers with methods that cannot be mocked.
  56. Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
  57. Mocking methods declared on non-public parent classes is not supported.
  58. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.setUp(ProductOrderServiceFulfillmentMultiModeTest.java:37)
  59. ship_virtual_rejectsManualShipAndIdempotent Time elapsed: 0.005 s <<< ERROR!
  60. java.lang.NullPointerException
  61. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  62. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.ship_virtual_rejectsManualShipAndIdempotent(ProductOrderServiceFulfillmentMultiModeTest.java:168)
  63. autoShipVirtualOrder_onPaySuccess Time elapsed: 0.001 s <<< ERROR!
  64. org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
  65. Misplaced or misused argument matcher detected here:
  66. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  67. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  68. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  69. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  70. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  71. -> at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.stubBuyerWithOpenid(ProductOrderServiceFulfillmentMultiModeTest.java:71)
  72. You cannot use argument matchers outside of verification or stubbing.
  73. Examples of correct usage of argument matchers:
  74. when(mock.get(anyInt())).thenReturn(null);
  75. doThrow(new RuntimeException()).when(mock).someVoidMethod(any());
  76. verify(mock).someMethod(contains("foo"))
  77. This message may appear after an NullPointerException if the last matcher is returning an object
  78. like any() but the stubbed method signature expect a primitive argument, in this case,
  79. use primitive alternatives.
  80. when(mock.get(any())); // bad use, will raise NPE
  81. when(mock.get(anyInt())); // correct usage use
  82. Also, this error might show up because you use argument matchers with methods that cannot be mocked.
  83. Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
  84. Mocking methods declared on non-public parent classes is not supported.
  85. at com.etotem.cfc.service.ProductOrderServiceFulfillmentMultiModeTest.setUp(ProductOrderServiceFulfillmentMultiModeTest.java:37)