|
@@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
|
|
class OmgLegacyRetirementTest {
|
|
class OmgLegacyRetirementTest {
|
|
|
@Test
|
|
@Test
|
|
|
- void oldRuntimeClassesAreAbsentAndNewControllerExposesOnlyCreateAndNotify() {
|
|
|
|
|
|
|
+ void oldRuntimeClassesAreAbsentAndNewControllerExposesSupportedPaymentOperations() {
|
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.app.pay.OmgPayController"));
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.app.pay.OmgPayController"));
|
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.app.task.OmgReconcileTask"));
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.app.task.OmgReconcileTask"));
|
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.system.domain.PosOrderOmgPayment"));
|
|
assertThrows(ClassNotFoundException.class, () -> Class.forName("com.ruoyi.system.domain.PosOrderOmgPayment"));
|
|
@@ -21,10 +21,9 @@ class OmgLegacyRetirementTest {
|
|
|
.filter(method -> method.isAnnotationPresent(PostMapping.class))
|
|
.filter(method -> method.isAnnotationPresent(PostMapping.class))
|
|
|
.flatMap(method -> Arrays.stream(method.getAnnotation(PostMapping.class).value()))
|
|
.flatMap(method -> Arrays.stream(method.getAnnotation(PostMapping.class).value()))
|
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
|
- assertEquals(Set.of("/create", "/notify"), postPaths);
|
|
|
|
|
|
|
+ assertEquals(Set.of("/create", "/notify", "/query", "/refund"), postPaths);
|
|
|
assertTrue(Arrays.stream(OmgPaymentController.class.getDeclaredMethods())
|
|
assertTrue(Arrays.stream(OmgPaymentController.class.getDeclaredMethods())
|
|
|
.map(method -> method.getName().toLowerCase())
|
|
.map(method -> method.getName().toLowerCase())
|
|
|
- .noneMatch(name -> name.contains("query") || name.contains("paymentinfo")
|
|
|
|
|
- || name.contains("return") || name.contains("refund")));
|
|
|
|
|
|
|
+ .noneMatch(name -> name.contains("paymentinfo") || name.contains("return")));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|