package com.google.sps.utilities;

import com.google.cloud.Date;
import com.google.sps.data.Event;
import com.google.sps.data.User;
import com.google.sps.data.VolunteeringOpportunity;
import com.google.sps.data.OpportunitySignup;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

/* Class containing utilities for testing. */
public class TestUtils {
  private static final String NAME = "Bob Smith";
  private static final String EMAIL = "bobsmith@example.com";
  private static final String EVENT_NAME = "Team Meeting";
  private static final String DESCRIPTION = "Daily Team Sync";
  private static final Set<String> LABELS =
      Collections.unmodifiableSet(new HashSet<>(Arrays.asList("Tech", "Work")));
  private static final String LOCATION = "Remote";
  private static final Date DATE = Date.fromYearMonthDay(2016, 9, 15);
  private static final String DATE_STRING = "09/15/2016";
  private static final String TIME = "3:00PM-5:00PM";
  private static final User HOST = new User.Builder(NAME, EMAIL).build();
  private static final String EVENT_ID = "0883de79-17d7-49a3-a866-dbd5135062a8";
  private static final String OPPORTUNITY_NAME = "Performer";
  private static final int NUMBER_OF_SPOTS = 240;
  private static final String VOLUNTEER_EMAIL = "volunteer@gmail.com";

  public static User newUser() {
    return new User.Builder(NAME, EMAIL).build(); 
  }

  public static Event newEvent() {
    return new Event.Builder(EVENT_NAME, DESCRIPTION, LABELS, LOCATION, DATE, TIME, HOST).build();
  }

  public static VolunteeringOpportunity newVolunteeringOpportunity() {
    return new VolunteeringOpportunity.Builder(EVENT_ID, OPPORTUNITY_NAME, NUMBER_OF_SPOTS).build();
  }

  /*
   * Return a new volunteering opportunity object with the given eventId.
   * @param eventId
   */
  public static VolunteeringOpportunity newVolunteeringOpportunityWithEventId(String eventId) {
    return new VolunteeringOpportunity.Builder(eventId, NAME, NUMBER_OF_SPOTS).build();
  }

  /*
   * Return a new opportunitySignup object with the given opportunityId.
   * @param opportunityId
   */
  public static OpportunitySignup newOpportunitySignupWithOpportunityId(String opportunityId) {
    return new OpportunitySignup.Builder(opportunityId, VOLUNTEER_EMAIL).build();
  }
 
  public static String newRandomId() {
    return UUID.randomUUID().toString();
  }
}

@@ -1353,16 +1353,78 @@
 .com%22;%0A%0A
+%0A  /** Return a new User object with arbitrary attributes. */%0A
   public
@@ -1510,37 +1510,470 @@
 %0A%0A  
-public static Event newEvent(
+/*%0A   * Return a new user with given email.%0A   * @param email used to create a User object.%0A   * @return a user with given email%0A   */%0A  public static User newUserWithEmail(String email) %7B%0A    return new User.Builder(NAME, email).build();%0A  %7D%0A%0A  /*%0A   * Return a new Event object with the given eventId.%0A   * @param user host to be used to create a Event object%0A   * @return an event with given user as host%0A   */%0A  public static Event newEventWithHost(User user
 ) %7B%0A
@@ -2056,20 +2056,20 @@
 , TIME, 
-HOST
+user
 ).build(
@@ -2076,16 +2076,96 @@
 );%0A  %7D%0A%0A
+  /** Return a new VolunteeringOpportunity object with arbitrary parameters. */%0A
   public
@@ -2356,17 +2356,17 @@
 n a new 
-v
+V
 olunteer
@@ -2364,26 +2364,25 @@
 Volunteering
- o
+O
 pportunity o
@@ -2430,16 +2430,138 @@
  eventId
+ event ID  used to create a VolunteeringOpportunity object%0A   * @return a volunteering opportunity with the given event ID
 %0A   */%0A 
@@ -2711,16 +2711,28 @@
 ventId, 
+OPPORTUNITY_
 NAME, NU
@@ -2783,17 +2783,17 @@
 n a new 
-o
+O
 pportuni
@@ -2863,16 +2863,129 @@
 tunityId
+ opportunity ID to create a OpportunitySignup object%0A   * @return an opportunity signup with given opportunity ID
 %0A   */%0A 
@@ -3166,16 +3166,47 @@
 );%0A  %7D%0A 
+ %0A  /** Returns a random ID. */
 %0A  publi

Add test utilities.