Added recording of persons to the backend.
This commit is contained in:
parent
77a0077be1
commit
bee72b152c
@ -22,13 +22,15 @@ data class NewObservation(
|
|||||||
val observed: String,
|
val observed: String,
|
||||||
val whom: String,
|
val whom: String,
|
||||||
val entries: List<Entry>,
|
val entries: List<Entry>,
|
||||||
val tutors: List<Long>
|
val tutors: List<Long>,
|
||||||
|
val persons: List<String>
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ObservationsRequest(
|
data class ObservationsRequest(
|
||||||
val site: Long?,
|
val site: Long?,
|
||||||
val tutor: Long?,
|
val tutor: Long?,
|
||||||
val whom: String?,
|
val whom: String?,
|
||||||
|
val person: String?,
|
||||||
val startDate: LocalDate,
|
val startDate: LocalDate,
|
||||||
val endDate: LocalDate
|
val endDate: LocalDate
|
||||||
)
|
)
|
||||||
|
@ -99,7 +99,8 @@ class Controller {
|
|||||||
teamworkWorkload = overallScores[RatingCategory.TEAMWORK_WORKLOAD],
|
teamworkWorkload = overallScores[RatingCategory.TEAMWORK_WORKLOAD],
|
||||||
knowledge = overallScores[RatingCategory.KNOWLEDGE],
|
knowledge = overallScores[RatingCategory.KNOWLEDGE],
|
||||||
entries = newObservation.entries,
|
entries = newObservation.entries,
|
||||||
tutors = tutors
|
tutors = tutors,
|
||||||
|
persons = newObservation.persons.asSequence().map { Person(it.toUpperCase()) }.toSet()
|
||||||
)
|
)
|
||||||
observation = observationRepository.save(observation)
|
observation = observationRepository.save(observation)
|
||||||
tutors.forEach {
|
tutors.forEach {
|
||||||
|
@ -92,7 +92,9 @@ data class Observation(
|
|||||||
val entries: List<Entry>,
|
val entries: List<Entry>,
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToMany(mappedBy = "observations")
|
@ManyToMany(mappedBy = "observations")
|
||||||
val tutors: Set<Tutor>
|
val tutors: Set<Tutor>,
|
||||||
|
@ElementCollection
|
||||||
|
val persons: Set<Person>
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,4 +114,10 @@ data class Entry(
|
|||||||
@Column(nullable = false, columnDefinition = "TEXT")
|
@Column(nullable = false, columnDefinition = "TEXT")
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
val improvements: String
|
val improvements: String
|
||||||
|
)
|
||||||
|
|
||||||
|
@Embeddable
|
||||||
|
data class Person(
|
||||||
|
@JsonProperty
|
||||||
|
val name: String
|
||||||
)
|
)
|
@ -93,8 +93,8 @@ class ControllerTest {
|
|||||||
val tutor = Tutor(1, "Foo Bar", site)
|
val tutor = Tutor(1, "Foo Bar", site)
|
||||||
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
||||||
doReturn(listOf(tutor)).`when`(tutorRepository).findAllById(listOf(1))
|
doReturn(listOf(tutor)).`when`(tutorRepository).findAllById(listOf(1))
|
||||||
val newData = NewObservation(1, TrainingType.INITIAL, "An Observation", "Group A", listOf(Entry(RatingCategory.MONITORING, 5, "", "")), listOf(1))
|
val newData = NewObservation(1, TrainingType.INITIAL, "An Observation", "Group A", listOf(Entry(RatingCategory.MONITORING, 5, "", "")), listOf(1), listOf())
|
||||||
val observation = Observation(1, site, LocalDate.now(), TrainingType.INITIAL, "An Observation", "Group A", 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, newData.entries, setOf(tutor))
|
val observation = Observation(1, site, LocalDate.now(), TrainingType.INITIAL, "An Observation", "Group A", 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, newData.entries, setOf(tutor), setOf())
|
||||||
doReturn(observation).`when`(observationRepository).save(ArgumentMatchers.any())
|
doReturn(observation).`when`(observationRepository).save(ArgumentMatchers.any())
|
||||||
val result = controller.addObservation(newData)
|
val result = controller.addObservation(newData)
|
||||||
assertEquals(1L, result)
|
assertEquals(1L, result)
|
||||||
@ -102,19 +102,19 @@ class ControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetObservations_SiteAndTutorNull() {
|
fun testGetObservations_SiteAndTutorNull() {
|
||||||
val request = ObservationsRequest(null, null, "", LocalDate.now(), LocalDate.now())
|
val request = ObservationsRequest(null, null, "", "", LocalDate.now(), LocalDate.now())
|
||||||
val result = controller.getObservations(request)
|
val result = controller.getObservations(request)
|
||||||
assertTrue(result.isEmpty())
|
assertTrue(result.isEmpty())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetObservations_WithSite_TutorNull_NoWhom() {
|
fun testGetObservations_WithSite_TutorNull_NoWhom() {
|
||||||
val request = ObservationsRequest(1, null, "", LocalDate.now(), LocalDate.now())
|
val request = ObservationsRequest(1, null, "", "", LocalDate.now(), LocalDate.now())
|
||||||
val site = Site(1, "Area 51")
|
val site = Site(1, "Area 51")
|
||||||
val observation = Observation(site = site, date = LocalDate.now(),
|
val observation = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf())
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(), persons = setOf())
|
||||||
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
||||||
doReturn(listOf(observation))
|
doReturn(listOf(observation))
|
||||||
.`when`(observationRepository).findBySiteAndDateBetween(site, LocalDate.now(), LocalDate.now())
|
.`when`(observationRepository).findBySiteAndDateBetween(site, LocalDate.now(), LocalDate.now())
|
||||||
@ -125,12 +125,12 @@ class ControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetObservations_WithSite_TutorNull_WithWhom() {
|
fun testGetObservations_WithSite_TutorNull_WithWhom() {
|
||||||
val request = ObservationsRequest(1, null, "Group A", LocalDate.now(), LocalDate.now())
|
val request = ObservationsRequest(1, null, "Group A", "", LocalDate.now(), LocalDate.now())
|
||||||
val site = Site(1, "Area 51")
|
val site = Site(1, "Area 51")
|
||||||
val observation = Observation(site = site, date = LocalDate.now(),
|
val observation = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "Group A", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "Group A", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf())
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(), persons = setOf())
|
||||||
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
doReturn(Optional.of(site)).`when`(siteRepository).findById(1)
|
||||||
doReturn(listOf(observation))
|
doReturn(listOf(observation))
|
||||||
.`when`(observationRepository).findBySiteAndWhomAndDateBetween(site, "Group A", LocalDate.now(), LocalDate.now())
|
.`when`(observationRepository).findBySiteAndWhomAndDateBetween(site, "Group A", LocalDate.now(), LocalDate.now())
|
||||||
@ -141,13 +141,13 @@ class ControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetObservations_WithSite_WithTutor_NoWhom() {
|
fun testGetObservations_WithSite_WithTutor_NoWhom() {
|
||||||
val request = ObservationsRequest(null, 1, "", LocalDate.now(), LocalDate.now())
|
val request = ObservationsRequest(null, 1, "", "", LocalDate.now(), LocalDate.now())
|
||||||
val site = Site(1, "Area 51")
|
val site = Site(1, "Area 51")
|
||||||
val tutor = Tutor(1, "Mr Unknown", site)
|
val tutor = Tutor(1, "Mr Unknown", site)
|
||||||
val observation = Observation(site = site, date = LocalDate.now(),
|
val observation = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf())
|
||||||
doReturn(Optional.of(tutor)).`when`(tutorRepository).findById(1)
|
doReturn(Optional.of(tutor)).`when`(tutorRepository).findById(1)
|
||||||
doReturn(listOf(observation))
|
doReturn(listOf(observation))
|
||||||
.`when`(observationRepository).findByTutorsAndDateBetween(tutor, LocalDate.now(), LocalDate.now())
|
.`when`(observationRepository).findByTutorsAndDateBetween(tutor, LocalDate.now(), LocalDate.now())
|
||||||
@ -158,13 +158,13 @@ class ControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testGetObservations_WithSite_WithTutor_WithWhom() {
|
fun testGetObservations_WithSite_WithTutor_WithWhom() {
|
||||||
val request = ObservationsRequest(null, 1, "Group A", LocalDate.now(), LocalDate.now())
|
val request = ObservationsRequest(null, 1, "Group A", "", LocalDate.now(), LocalDate.now())
|
||||||
val site = Site(1, "Area 51")
|
val site = Site(1, "Area 51")
|
||||||
val tutor = Tutor(1, "Mr Unknown", site)
|
val tutor = Tutor(1, "Mr Unknown", site)
|
||||||
val observation = Observation(site = site, date = LocalDate.now(),
|
val observation = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "Group A", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "Group A", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf())
|
||||||
doReturn(Optional.of(tutor)).`when`(tutorRepository).findById(1)
|
doReturn(Optional.of(tutor)).`when`(tutorRepository).findById(1)
|
||||||
doReturn(listOf(observation))
|
doReturn(listOf(observation))
|
||||||
.`when`(observationRepository).findByTutorsAndWhomAndDateBetween(tutor, "Group A", LocalDate.now(), LocalDate.now())
|
.`when`(observationRepository).findByTutorsAndWhomAndDateBetween(tutor, "Group A", LocalDate.now(), LocalDate.now())
|
||||||
|
@ -52,19 +52,19 @@ class RepositoryTest {
|
|||||||
val tooEarly = Observation(site = correctSite, date = LocalDate.now().minusDays(5),
|
val tooEarly = Observation(site = correctSite, date = LocalDate.now().minusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
val tooLate = Observation(site = correctSite, date = LocalDate.now().plusDays(5),
|
val tooLate = Observation(site = correctSite, date = LocalDate.now().plusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongSite = Observation(site = incorrectSite, date = LocalDate.now(),
|
val wrongSite = Observation(site = incorrectSite, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor2))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor2), persons = setOf(Person("Foo Bar")))
|
||||||
val justRight = Observation(site = correctSite, date = LocalDate.now(),
|
val justRight = Observation(site = correctSite, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
entityManager.persist(tooEarly)
|
entityManager.persist(tooEarly)
|
||||||
entityManager.persist(tooLate)
|
entityManager.persist(tooLate)
|
||||||
entityManager.persist(wrongSite)
|
entityManager.persist(wrongSite)
|
||||||
@ -83,23 +83,23 @@ class RepositoryTest {
|
|||||||
val tooEarly = Observation(site = correctSite, date = LocalDate.now().minusDays(5),
|
val tooEarly = Observation(site = correctSite, date = LocalDate.now().minusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
val tooLate = Observation(site = correctSite, date = LocalDate.now().plusDays(5),
|
val tooLate = Observation(site = correctSite, date = LocalDate.now().plusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongSite = Observation(site = incorrectSite, date = LocalDate.now(),
|
val wrongSite = Observation(site = incorrectSite, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor2))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor2), persons = setOf(Person("Foo Bar")))
|
||||||
val justRight = Observation(site = correctSite, date = LocalDate.now(),
|
val justRight = Observation(site = correctSite, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongWhom = Observation(site = correctSite, date = LocalDate.now(),
|
val wrongWhom = Observation(site = correctSite, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G2", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G2", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(tutor), persons = setOf(Person("Foo Bar")))
|
||||||
entityManager.persist(tooEarly)
|
entityManager.persist(tooEarly)
|
||||||
entityManager.persist(tooLate)
|
entityManager.persist(tooLate)
|
||||||
entityManager.persist(wrongSite)
|
entityManager.persist(wrongSite)
|
||||||
@ -118,23 +118,23 @@ class RepositoryTest {
|
|||||||
val tooEarly = Observation(site = site, date = LocalDate.now().minusDays(5),
|
val tooEarly = Observation(site = site, date = LocalDate.now().minusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val tooLate = Observation(site = site, date = LocalDate.now().plusDays(5),
|
val tooLate = Observation(site = site, date = LocalDate.now().plusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongTutor = Observation(site = site, date = LocalDate.now(),
|
val wrongTutor = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(incorrectTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(incorrectTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val justRight = Observation(site = site, date = LocalDate.now(),
|
val justRight = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val justRightMultipleTutors = Observation(site = site, date = LocalDate.now(),
|
val justRightMultipleTutors = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor, incorrectTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor, incorrectTutor), persons = setOf(Person("Foo Bar")))
|
||||||
entityManager.persist(tooEarly)
|
entityManager.persist(tooEarly)
|
||||||
entityManager.persist(tooLate)
|
entityManager.persist(tooLate)
|
||||||
entityManager.persist(wrongTutor)
|
entityManager.persist(wrongTutor)
|
||||||
@ -159,27 +159,27 @@ class RepositoryTest {
|
|||||||
val tooEarly = Observation(site = site, date = LocalDate.now().minusDays(5),
|
val tooEarly = Observation(site = site, date = LocalDate.now().minusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val tooLate = Observation(site = site, date = LocalDate.now().plusDays(5),
|
val tooLate = Observation(site = site, date = LocalDate.now().plusDays(5),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongTutor = Observation(site = site, date = LocalDate.now(),
|
val wrongTutor = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(incorrectTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(incorrectTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val justRight = Observation(site = site, date = LocalDate.now(),
|
val justRight = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val wrongGroup = Observation(site = site, date = LocalDate.now(),
|
val wrongGroup = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G2", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G2", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor), persons = setOf(Person("Foo Bar")))
|
||||||
val justRightMultipleTutors = Observation(site = site, date = LocalDate.now(),
|
val justRightMultipleTutors = Observation(site = site, date = LocalDate.now(),
|
||||||
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
type = TrainingType.INITIAL, observed = "1", whom = "G1", monitoring = 5.0, controlProcedural = 3.0,
|
||||||
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
control = 4.0, conservatism = 3.0, teamworkCommunications = 2.0, teamworkLeadership = 3.0,
|
||||||
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor, incorrectTutor))
|
teamworkWorkload = 1.0, knowledge = 1.0, entries = listOf(), tutors = setOf(correctTutor, incorrectTutor), persons = setOf(Person("Foo Bar")))
|
||||||
entityManager.persist(tooEarly)
|
entityManager.persist(tooEarly)
|
||||||
entityManager.persist(tooLate)
|
entityManager.persist(tooLate)
|
||||||
entityManager.persist(wrongTutor)
|
entityManager.persist(wrongTutor)
|
||||||
|
Loading…
Reference in New Issue
Block a user