summaryrefslogtreecommitdiff
path: root/src/test/java/com/stileeducation/markr/util/TestBuilder.java
blob: e247f672d623d883e650d9b017deddd44412d83d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.stileeducation.markr.util;

import com.stileeducation.markr.entity.Test;

public class TestBuilder {
  private Long id;
  private String testId;
  private Integer marksAvailable;

  public TestBuilder withId(Long id) {
    this.id = id;
    return this;
  }

  public TestBuilder withTestId(String testId) {
    this.testId = testId;
    return this;
  }

  public TestBuilder withMarksAvailable(Integer marksAvailable) {
    this.marksAvailable = marksAvailable;
    return this;
  }

  public Test build() {
    Test test = new Test();
    test.setId(id);
    test.setTestId(testId);
    test.setMarksAvailable(marksAvailable);
    return test;
  }
}