summaryrefslogtreecommitdiff
path: root/src/test/java/com/stileeducation
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/stileeducation')
-rw-r--r--src/test/java/com/stileeducation/markr/util/StudentBuilder.java12
-rw-r--r--src/test/java/com/stileeducation/markr/util/TestBuilder.java11
-rw-r--r--src/test/java/com/stileeducation/markr/util/TestResultBuilder.java8
3 files changed, 5 insertions, 26 deletions
diff --git a/src/test/java/com/stileeducation/markr/util/StudentBuilder.java b/src/test/java/com/stileeducation/markr/util/StudentBuilder.java
index 5189f19..897d84a 100644
--- a/src/test/java/com/stileeducation/markr/util/StudentBuilder.java
+++ b/src/test/java/com/stileeducation/markr/util/StudentBuilder.java
@@ -1,17 +1,13 @@
package com.stileeducation.markr.util;
import com.stileeducation.markr.entity.Student;
-import com.stileeducation.markr.entity.TestResult;
-
-import java.util.HashSet;
-import java.util.Set;
public class StudentBuilder {
private Long id;
private String firstName;
private String lastName;
private String studentNumber;
- private Set<TestResult> testResults = new HashSet<>();
+
public StudentBuilder withId(Long id) {
this.id = id;
@@ -33,18 +29,12 @@ public class StudentBuilder {
return this;
}
- public StudentBuilder withTestResults(Set<TestResult> testResults) {
- this.testResults = testResults;
- return this;
- }
-
public Student build() {
Student student = new Student();
student.setId(id);
student.setFirstName(firstName);
student.setLastName(lastName);
student.setStudentNumber(studentNumber);
- student.setTestResults(testResults);
return student;
}
} \ No newline at end of file
diff --git a/src/test/java/com/stileeducation/markr/util/TestBuilder.java b/src/test/java/com/stileeducation/markr/util/TestBuilder.java
index 5c513f3..e247f67 100644
--- a/src/test/java/com/stileeducation/markr/util/TestBuilder.java
+++ b/src/test/java/com/stileeducation/markr/util/TestBuilder.java
@@ -1,16 +1,11 @@
package com.stileeducation.markr.util;
import com.stileeducation.markr.entity.Test;
-import com.stileeducation.markr.entity.TestResult;
-
-import java.util.HashSet;
-import java.util.Set;
public class TestBuilder {
private Long id;
private String testId;
private Integer marksAvailable;
- private Set<TestResult> testResults = new HashSet<>();
public TestBuilder withId(Long id) {
this.id = id;
@@ -27,17 +22,11 @@ public class TestBuilder {
return this;
}
- public TestBuilder withTestResults(Set<TestResult> testResults) {
- this.testResults = testResults;
- return this;
- }
-
public Test build() {
Test test = new Test();
test.setId(id);
test.setTestId(testId);
test.setMarksAvailable(marksAvailable);
- test.setTestResults(testResults);
return test;
}
}
diff --git a/src/test/java/com/stileeducation/markr/util/TestResultBuilder.java b/src/test/java/com/stileeducation/markr/util/TestResultBuilder.java
index db26e15..70fcecd 100644
--- a/src/test/java/com/stileeducation/markr/util/TestResultBuilder.java
+++ b/src/test/java/com/stileeducation/markr/util/TestResultBuilder.java
@@ -8,7 +8,7 @@ public class TestResultBuilder {
private Long id;
private Student student;
private Test test;
- private Integer marksAwarded;
+ private Integer marksObtained;
public TestResultBuilder withId(Long id) {
this.id = id;
@@ -25,12 +25,12 @@ public class TestResultBuilder {
return this;
}
- public TestResultBuilder withMarksAwarded(Integer marksAwarded) {
- this.marksAwarded = marksAwarded;
+ public TestResultBuilder withMarksObtained(Integer marksObtained) {
+ this.marksObtained = marksObtained;
return this;
}
public TestResult build() {
- return new TestResult(id, student, test, marksAwarded);
+ return new TestResult(id, student, test, marksObtained);
}
} \ No newline at end of file