/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd.model;

import com.google.android.gnd.model.feature.Feature;
import com.google.android.gnd.model.feature.Point;
import com.google.android.gnd.model.form.Form;
import com.google.android.gnd.model.layer.Layer;
import com.google.android.gnd.model.layer.Style;
import java.util.Date;

/**
 * Helper methods for building model objects for use in tests. Method return builders with required
 * fields set to placeholder values. Rather than depending on these values, tests that test for
 * specific values should explicitly set them in relevant test methods or during test setup.
 */
public class TestModelBuilders {
  public static Project.Builder newTestProject() {
    return Project.newBuilder().setId("").setTitle("").setDescription("");
  }

  public static User.Builder newTestUser() {
    return User.builder().setId("").setEmail("").setDisplayName("");
  }

  public static AuditInfo.Builder newTestAuditInfo() {
    return AuditInfo.builder().setClientTimestamp(new Date(0)).setUser(newTestUser().build());
  }

  public static Point.Builder newTestPoint() {
    return Point.newBuilder().setLatitude(0).setLongitude(0);
  }

  public static Feature.Builder newTestFeature() {
    return Feature.newBuilder()
        .setId("")
        .setProject(newTestProject().build())
        .setPoint(newTestPoint().build())
        .setCreated(newTestAuditInfo().build())
        .setLastModified(newTestAuditInfo().build());
  }

  public static Layer.Builder newTestLayer() {
    return Layer.newBuilder().setId("").setName("").setDefaultStyle(newTestStyle().build());
  }

  public static Style.Builder newTestStyle() {
    return Style.builder().setColor("");
  }

  public static Form.Builder newTestForm() {
    return Form.newBuilder().setId("");
  }
}

@@ -1266,20 +1266,16 @@
 lder new
-Test
 Project(
@@ -1390,20 +1390,16 @@
 lder new
-Test
 User() %7B
@@ -1510,20 +1510,16 @@
 lder new
-Test
 AuditInf
@@ -1598,20 +1598,16 @@
 User(new
-Test
 User().b
@@ -1653,20 +1653,16 @@
 lder new
-Test
 Point() 
@@ -1765,20 +1765,16 @@
 lder new
-Test
 Feature(
@@ -1851,20 +1851,16 @@
 ject(new
-Test
 Project(
@@ -1891,20 +1891,16 @@
 oint(new
-Test
 Point().
@@ -1927,28 +1927,24 @@
 tCreated(new
-Test
 AuditInfo().
@@ -1980,20 +1980,16 @@
 fied(new
-Test
 AuditInf
@@ -2040,20 +2040,16 @@
 lder new
-Test
 Layer() 
@@ -2121,20 +2121,16 @@
 tyle(new
-Test
 Style().
@@ -2177,20 +2177,16 @@
 lder new
-Test
 Style() 
@@ -2265,20 +2265,16 @@
 lder new
-Test
 Form() %7B

Remove redundant qualifiers from method names