Skip to content

Commit

Permalink
Use different test to assert nothing thrown.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel committed Jan 15, 2025
1 parent ebebe4c commit fbcb111
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;

import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.session.AbstractSessionDataStoreFactory;
import org.eclipse.jetty.session.AbstractSessionDataStoreTest;
import org.eclipse.jetty.session.DefaultSessionCache;
import org.eclipse.jetty.session.DefaultSessionCacheFactory;
import org.eclipse.jetty.session.DefaultSessionIdManager;
import org.eclipse.jetty.session.ManagedSession;
import org.eclipse.jetty.session.SessionContext;
import org.eclipse.jetty.session.SessionData;
import org.eclipse.jetty.session.SessionDataStore;
Expand All @@ -39,10 +36,10 @@
import org.junit.jupiter.api.Test;
import org.testcontainers.junit.jupiter.Testcontainers;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.testcontainers.shaded.org.hamcrest.Matchers.not;

/**
* MongoSessionDataStoreTest
Expand Down Expand Up @@ -184,10 +181,8 @@ public void testGoodWorkerName() throws Exception
SessionDataStoreFactory factory = createSessionDataStoreFactory();
server.addBean(factory);

not(assertThrows(IllegalStateException.class, () ->
{
server.start();
}));
assertDoesNotThrow(() ->
server.start());
}

@Test
Expand All @@ -211,10 +206,8 @@ public void testDefaultWorkerName() throws Exception
SessionDataStoreFactory factory = createSessionDataStoreFactory();
server.addBean(factory);

not(assertThrows(IllegalStateException.class, () ->
{
server.start();
}));
assertDoesNotThrow(() ->
server.start());
}

/**
Expand Down

0 comments on commit fbcb111

Please sign in to comment.