MutationKeyEncoder { @VisibleForTesting static Map<String, AtomicInteger> getUnknownTablesWarningsMap() { return unknownTablesWarnings; } MutationKeyEncoder(SpannerSchema schema); byte[] encodeTableNameAndKey(Mutation m);  }
@Test public void unknownTableOrdering() throws Exception { SpannerSchema.Builder builder = SpannerSchema.builder(); builder.addColumn("test1", "key", "INT64"); builder.addKeyPart("test1", "key", false); SpannerSchema schema = builder.build(); List<Mutation> sortedMutations = Arrays.asList( Mutation.newInsertOrUpdateBuilder("test2") .set("key") .to("a") .set("keydesc") .to("a") .build(), Mutation.newInsertOrUpdateBuilder("test2") .set("key") .to("a") .set("keydesc") .to("b") .build(), Mutation.newInsertOrUpdateBuilder("test3") .set("key") .to("b") .build(), Mutation.newInsertOrUpdateBuilder("test4") .set("key") .to("b") .set("keydesc") .to("a") .build(), Mutation.newInsertOrUpdateBuilder("test4") .set("keydesc") .to("a") .build()); verifyEncodedOrdering(schema, sortedMutations); Assert.assertEquals(3, MutationKeyEncoder.getUnknownTablesWarningsMap().size()); Assert.assertEquals(2, MutationKeyEncoder.getUnknownTablesWarningsMap().get("test2").get()); Assert.assertEquals(1, MutationKeyEncoder.getUnknownTablesWarningsMap().get("test3").get()); Assert.assertEquals(2, MutationKeyEncoder.getUnknownTablesWarningsMap().get("test4").get()); }