1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.adservices.service.measurement; 18 19 import android.net.Uri; 20 21 import com.android.adservices.common.WebUtil; 22 import com.android.adservices.service.measurement.util.UnsignedLong; 23 24 import java.util.List; 25 import java.util.UUID; 26 27 public final class EventReportFixture { EventReportFixture()28 private EventReportFixture() {} 29 getBaseEventReportBuild()30 public static EventReport.Builder getBaseEventReportBuild() { 31 return new EventReport.Builder() 32 .setId(UUID.randomUUID().toString()) 33 .setSourceEventId(new UnsignedLong(21L)) 34 .setEnrollmentId("enrollment-id") 35 .setAttributionDestinations(List.of(Uri.parse("https://bar.test"))) 36 .setTriggerTime(1000L) 37 .setTriggerDedupKey(new UnsignedLong(3L)) 38 .setReportTime(2000L) 39 .setStatus(EventReport.Status.PENDING) 40 .setDebugReportStatus(EventReport.DebugReportStatus.PENDING) 41 .setSourceType(Source.SourceType.NAVIGATION) 42 .setSourceDebugKey(new UnsignedLong(237865L)) 43 .setTriggerDebugKey(new UnsignedLong(928762L)) 44 .setSourceId(UUID.randomUUID().toString()) 45 .setTriggerId(UUID.randomUUID().toString()) 46 .setRegistrationOrigin(WebUtil.validUri("https://subdomain.example.test")) 47 .setTriggerSummaryBucket("2,3"); 48 } 49 50 public static class ValidEventReportParams { 51 public static final long TRIGGER_TIME = 8640000000L; 52 } 53 } 54