From 65bb0e03b77d041ccd5f8a09352e02c4fe6d0896 Mon Sep 17 00:00:00 2001 From: loushang Date: Thu, 2 Jan 2020 20:08:14 +0800 Subject: [PATCH] fix SessionServiceTest testSignOut bug (add mock) --- .../dolphinscheduler/api/service/SessionServiceTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java index 72545a347c..ce334686f6 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SessionServiceTest.java @@ -121,6 +121,9 @@ public class SessionServiceTest { String ip = "127.0.0.1"; User user = new User(); user.setId(userId); + + Mockito.when(sessionMapper.queryByUserIdAndIp(userId,ip)).thenReturn(getSession()); + sessionService.signOut(ip ,user); }