File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/test/java/world/bentobox/border/listeners Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ public class ShowBarrierTest extends CommonTestSetup {
4747 @ Mock
4848 private @ NonNull Location center ;
4949
50+ private MockedStatic <User > mockedUser ;
51+
5052 /**
5153 * @throws java.lang.Exception
5254 */
@@ -77,7 +79,7 @@ public void setUp() throws Exception {
7779 when (im .getIslandAt (any (Location .class ))).thenReturn (Optional .of (island ));
7880
7981 // User
80- MockedStatic < User > mockedUser = Mockito .mockStatic (User .class , Mockito .RETURNS_MOCKS );
82+ mockedUser = Mockito .mockStatic (User .class , Mockito .RETURNS_MOCKS );
8183 mockedUser .when (() -> User .getInstance (any (Player .class ))).thenReturn (user );
8284 when (user .getMetaData (anyString ())).thenReturn (Optional .empty ());
8385 when (user .getPlayer ()).thenReturn (player );
@@ -98,6 +100,9 @@ public void setUp() throws Exception {
98100 @ Override
99101 @ AfterEach
100102 public void tearDown () throws Exception {
103+ if (mockedUser != null ) {
104+ mockedUser .close ();
105+ }
101106 super .tearDown ();
102107 }
103108
You can’t perform that action at this time.
0 commit comments