File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 19
19
import io .trino .testing .QueryRunner ;
20
20
import org .intellij .lang .annotations .Language ;
21
21
22
+ import java .util .List ;
23
+
22
24
import static com .google .common .collect .ImmutableMultiset .toImmutableMultiset ;
23
25
import static io .trino .testing .MultisetAssertions .assertMultisetsEqual ;
24
26
@@ -36,15 +38,18 @@ public static void assertMetastoreInvocationsForQuery(
36
38
{
37
39
queryRunner .execute (session , query );
38
40
39
- Multiset <MetastoreMethod > invocations = queryRunner .getSpans ().stream ()
41
+ assertMultisetsEqual (filterInvocations (queryRunner .getSpans ()), expectedInvocations );
42
+ }
43
+
44
+ public static Multiset <MetastoreMethod > filterInvocations (List <SpanData > spans )
45
+ {
46
+ return spans .stream ()
40
47
.map (SpanData ::getName )
41
48
.filter (name -> name .startsWith (TRACE_PREFIX ))
42
49
.map (name -> name .substring (TRACE_PREFIX .length ()))
43
50
.filter (name -> !name .equals ("listRoleGrants" ))
44
51
.filter (name -> !name .equals ("listTablePrivileges" ))
45
52
.map (MetastoreMethod ::fromMethodName )
46
53
.collect (toImmutableMultiset ());
47
-
48
- assertMultisetsEqual (invocations , expectedInvocations );
49
54
}
50
55
}
You can’t perform that action at this time.
0 commit comments