@Test public void logLocationCoordinatesOnlyIfAllParametersAreSet() { AuditConfig auditConfig = new AuditConfig.Builder().setMode("high-accuracy").setLocationMinInterval("10").setLocationMaxAge("60").setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertTrue(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode(null).setLocationMinInterval("10").setLocationMaxAge("60").setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode(null).setLocationMinInterval(null).setLocationMaxAge("60").setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode(null).setLocationMinInterval(null).setLocationMaxAge(null).setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode("balanced").setLocationMinInterval(null).setLocationMaxAge(null).setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode("balanced").setLocationMinInterval("10").setLocationMaxAge(null).setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode("balanced").setLocationMinInterval(null).setLocationMaxAge("60").setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); auditConfig = new AuditConfig.Builder().setMode(null).setLocationMinInterval(null).setLocationMaxAge("60").setIsTrackingChangesEnabled(false).setIsIdentifyUserEnabled(false).setIsTrackChangesReasonEnabled(false).createAuditConfig(); assertFalse(auditConfig.isLocationEnabled()); }
public boolean isLocationEnabled() { return locationPriority != null && locationMinInterval != null && locationMaxAge != null; }
AuditConfig { public boolean isLocationEnabled() { return locationPriority != null && locationMinInterval != null && locationMaxAge != null; } }
AuditConfig { public boolean isLocationEnabled() { return locationPriority != null && locationMinInterval != null && locationMaxAge != null; } AuditConfig(String mode, String locationMinInterval, String locationMaxAge, boolean isTrackingChangesEnabled, boolean isIdentifyUserEnabled, boolean isTrackChangesReasonEnabled); }
AuditConfig { public boolean isLocationEnabled() { return locationPriority != null && locationMinInterval != null && locationMaxAge != null; } AuditConfig(String mode, String locationMinInterval, String locationMaxAge, boolean isTrackingChangesEnabled, boolean isIdentifyUserEnabled, boolean isTrackChangesReasonEnabled); @Nullable LocationClient.Priority getLocationPriority(); @Nullable Long getLocationMinInterval(); @Nullable Long getLocationMaxAge(); boolean isLocationEnabled(); boolean isTrackingChangesEnabled(); boolean isIdentifyUserEnabled(); boolean isTrackChangesReasonEnabled(); }
AuditConfig { public boolean isLocationEnabled() { return locationPriority != null && locationMinInterval != null && locationMaxAge != null; } AuditConfig(String mode, String locationMinInterval, String locationMaxAge, boolean isTrackingChangesEnabled, boolean isIdentifyUserEnabled, boolean isTrackChangesReasonEnabled); @Nullable LocationClient.Priority getLocationPriority(); @Nullable Long getLocationMinInterval(); @Nullable Long getLocationMaxAge(); boolean isLocationEnabled(); boolean isTrackingChangesEnabled(); boolean isIdentifyUserEnabled(); boolean isTrackChangesReasonEnabled();  }