1
1
package io .scalecube .services ;
2
2
3
+ import static org .hamcrest .MatcherAssert .assertThat ;
4
+ import static org .hamcrest .Matchers .startsWith ;
3
5
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
6
import static org .junit .jupiter .api .Assertions .assertTrue ;
5
7
@@ -161,16 +163,16 @@ void testDefaultSchedulersOnMethods() {
161
163
final var api = microservices .call ().api (DefaultSchedulerOnServiceMethod .class );
162
164
163
165
api .parallel ().block ();
164
- assertEquals ( "parallel-1" , service .threadName .get (), "threadName" );
166
+ assertThat ( service .threadName .get (), startsWith ( "parallel" ) );
165
167
166
168
api .single ().block ();
167
- assertEquals ( "single-1" , service .threadName .get (), "threadName" );
169
+ assertThat ( service .threadName .get (), startsWith ( "single" ) );
168
170
169
171
api .boundedElastic ().block ();
170
- assertEquals ( "boundedElastic-1" , service .threadName .get (), "threadName" );
172
+ assertThat ( service .threadName .get (), startsWith ( "boundedElastic" ) );
171
173
172
174
api .immediate ().block ();
173
- assertEquals ( "main" , service .threadName .get (), "threadName" );
175
+ assertThat ( service .threadName .get (), startsWith ( "main" ) );
174
176
}
175
177
}
176
178
@@ -182,7 +184,7 @@ void testDefaultSchedulersOnService() {
182
184
final var api = microservices .call ().api (DefaultSchedulerOnService .class );
183
185
184
186
api .hello ().block ();
185
- assertEquals ( "single-1" , service .threadName .get (), "threadName" );
187
+ assertThat ( service .threadName .get (), startsWith ( "single" ) );
186
188
}
187
189
}
188
190
0 commit comments