@Test public void testBug1642386Affected() throws Exception { Map<String, String> baseAttributes = ImmutableMap.<String, String>builder() .put(Attribute.DOCUMENT_NAMESPACE, ParseUri.TELEMETRY).put(Attribute.DOCUMENT_TYPE, "sync") .build(); assertFalse(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "60.6.1").build())); assertFalse(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "28.1").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "27.1").build())); assertFalse(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "100.0").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "25.0.1").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "26.1").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "14.1").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "8.0.2").build())); assertTrue(MessageScrubber.bug1642386Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "10.0.2").build())); }
@VisibleForTesting static boolean bug1642386Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && attributes.get(Attribute.DOCUMENT_TYPE).equals("sync") && attributes.get(Attribute.APP_VERSION) != null && attributes.get(Attribute.APP_VERSION).matches("^([0-9]|[0-2][0-7])\\..*"); }
MessageScrubber { @VisibleForTesting static boolean bug1642386Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && attributes.get(Attribute.DOCUMENT_TYPE).equals("sync") && attributes.get(Attribute.APP_VERSION) != null && attributes.get(Attribute.APP_VERSION).matches("^([0-9]|[0-2][0-7])\\..*"); } }
MessageScrubber { @VisibleForTesting static boolean bug1642386Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && attributes.get(Attribute.DOCUMENT_TYPE).equals("sync") && attributes.get(Attribute.APP_VERSION) != null && attributes.get(Attribute.APP_VERSION).matches("^([0-9]|[0-2][0-7])\\..*"); }  }
MessageScrubber { @VisibleForTesting static boolean bug1642386Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && attributes.get(Attribute.DOCUMENT_TYPE).equals("sync") && attributes.get(Attribute.APP_VERSION) != null && attributes.get(Attribute.APP_VERSION).matches("^([0-9]|[0-2][0-7])\\..*"); }  static void scrub(Map<String, String> attributes, ObjectNode json); }
MessageScrubber { @VisibleForTesting static boolean bug1642386Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && attributes.get(Attribute.DOCUMENT_TYPE).equals("sync") && attributes.get(Attribute.APP_VERSION) != null && attributes.get(Attribute.APP_VERSION).matches("^([0-9]|[0-2][0-7])\\..*"); }  static void scrub(Map<String, String> attributes, ObjectNode json);  }