@Test public void testBug1602844Affected() throws Exception { Map<String, String> baseAttributes = ImmutableMap.<String, String>builder() .put(Attribute.DOCUMENT_NAMESPACE, ParseUri.TELEMETRY) .put(Attribute.DOCUMENT_TYPE, "focus-event").put(Attribute.APP_NAME, "Lockbox").build(); assertFalse(MessageScrubber.bug1602844Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "1.7.1").build())); assertTrue(MessageScrubber.bug1602844Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "1.7.0").build())); assertTrue(MessageScrubber.bug1602844Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "1.6.1").build())); assertTrue(MessageScrubber.bug1602844Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "1.3").build())); assertTrue(MessageScrubber.bug1602844Affected(ImmutableMap.<String, String>builder() .putAll(baseAttributes).put(Attribute.APP_VERSION, "1.1.1").build())); }
@VisibleForTesting static boolean bug1602844Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && "focus-event".equals(attributes.get(Attribute.DOCUMENT_TYPE)) && "Lockbox".equals(attributes.get(Attribute.APP_NAME)) && attributes.get(Attribute.APP_VERSION) != null && ("1.7.0".equals(attributes.get(Attribute.APP_VERSION)) || attributes.get(Attribute.APP_VERSION).matches("^1\\.[0-6][0-9.]*")); }
MessageScrubber { @VisibleForTesting static boolean bug1602844Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && "focus-event".equals(attributes.get(Attribute.DOCUMENT_TYPE)) && "Lockbox".equals(attributes.get(Attribute.APP_NAME)) && attributes.get(Attribute.APP_VERSION) != null && ("1.7.0".equals(attributes.get(Attribute.APP_VERSION)) || attributes.get(Attribute.APP_VERSION).matches("^1\\.[0-6][0-9.]*")); } }
MessageScrubber { @VisibleForTesting static boolean bug1602844Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && "focus-event".equals(attributes.get(Attribute.DOCUMENT_TYPE)) && "Lockbox".equals(attributes.get(Attribute.APP_NAME)) && attributes.get(Attribute.APP_VERSION) != null && ("1.7.0".equals(attributes.get(Attribute.APP_VERSION)) || attributes.get(Attribute.APP_VERSION).matches("^1\\.[0-6][0-9.]*")); }  }
MessageScrubber { @VisibleForTesting static boolean bug1602844Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && "focus-event".equals(attributes.get(Attribute.DOCUMENT_TYPE)) && "Lockbox".equals(attributes.get(Attribute.APP_NAME)) && attributes.get(Attribute.APP_VERSION) != null && ("1.7.0".equals(attributes.get(Attribute.APP_VERSION)) || attributes.get(Attribute.APP_VERSION).matches("^1\\.[0-6][0-9.]*")); }  static void scrub(Map<String, String> attributes, ObjectNode json); }
MessageScrubber { @VisibleForTesting static boolean bug1602844Affected(Map<String, String> attributes) { return ParseUri.TELEMETRY.equals(attributes.get(Attribute.DOCUMENT_NAMESPACE)) && "focus-event".equals(attributes.get(Attribute.DOCUMENT_TYPE)) && "Lockbox".equals(attributes.get(Attribute.APP_NAME)) && attributes.get(Attribute.APP_VERSION) != null && ("1.7.0".equals(attributes.get(Attribute.APP_VERSION)) || attributes.get(Attribute.APP_VERSION).matches("^1\\.[0-6][0-9.]*")); }  static void scrub(Map<String, String> attributes, ObjectNode json);  }