/** See {@link ApiSurface#containsOnlyPackages(Set)}. */ public static Matcher<ApiSurface> containsOnlyPackages(final String... packageNames) { return containsOnlyPackages(Sets.newHashSet(packageNames)); }
@Test public void testSdkApiSurface() throws Exception { @SuppressWarnings("unchecked") final Set<String> allowed = ImmutableSet.of( "org.apache.beam", "com.fasterxml.jackson.annotation", "com.fasterxml.jackson.core", "com.fasterxml.jackson.databind", "org.apache.avro", "org.hamcrest", // via DataflowMatchers "org.codehaus.jackson", // via Avro "org.joda.time", "org.junit"); assertThat(getSdkApiSurface(getClass().getClassLoader()), containsOnlyPackages(allowed)); } }
.pruningPattern("java[.]util.*"); assertThat(apiSurface, containsOnlyPackages(allowed));