1818import esa .commons .concurrent .InternalThread ;
1919import org .junit .jupiter .api .Test ;
2020
21- import static org .junit .jupiter .api .Assertions .assertEquals ;
2221import static org .junit .jupiter .api .Assertions .assertFalse ;
2322import static org .junit .jupiter .api .Assertions .assertTrue ;
2423
@@ -29,26 +28,14 @@ void testNewThread() {
2928 LoggedThreadFactory factory = new LoggedThreadFactory ("foo" , true );
3029 Thread thread = factory .newThread (() -> {
3130 });
32- assertEquals ("foo-0#0" , thread .getName ());
33- assertTrue (thread .isDaemon ());
34- assertTrue (thread instanceof InternalThread );
35-
36- thread = factory .newThread (() -> {
37- });
38- assertEquals ("foo-0#1" , thread .getName ());
31+ assertTrue (thread .getName ().startsWith ("foo" ));
3932 assertTrue (thread .isDaemon ());
4033 assertTrue (thread instanceof InternalThread );
4134
4235 factory = new LoggedThreadFactory ("bar" );
4336 thread = factory .newThread (() -> {
4437 });
45- assertEquals ("bar-1#0" , thread .getName ());
46- assertFalse (thread .isDaemon ());
47- assertTrue (thread instanceof InternalThread );
48-
49- thread = factory .newThread (() -> {
50- });
51- assertEquals ("bar-1#1" , thread .getName ());
38+ assertTrue (thread .getName ().startsWith ("bar" ));
5239 assertFalse (thread .isDaemon ());
5340 assertTrue (thread instanceof InternalThread );
5441 }
0 commit comments