Created
July 12, 2024 13:57
-
-
Save JonasGao/02274da3ee637f517d3133cb0ec0650f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RedisSessionHandlerValve valve = new RedisSessionHandlerValve(); | |
Pipeline pipeline = Mockito.mock(Pipeline.class); | |
Container container = Mockito.mock(Container.class); | |
Context context = Mockito.mock(Context.class); | |
Mockito.when(context.getParent()).thenReturn(container); | |
Mockito.when(context.getName()).thenReturn("/"); | |
Mockito.when(context.getPipeline()).thenReturn(pipeline); | |
Mockito.when(container.getName()).thenReturn("Nice"); | |
Mockito.when(pipeline.getValves()).thenReturn(new Valve[] {valve}); | |
RedisSessionManager manager = new RedisSessionManager(); | |
manager.setHost("172.16.201.13"); | |
manager.setPort(6379); | |
manager.setContext(context); | |
manager.start(); | |
Session aaaa = manager.findSession("aaaa"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment