Skip to content

Commit 4f8a887

Browse files
committed
add AnswerType enum, fix enums localisation, fix fake-datas
1 parent ff7b6e8 commit 4f8a887

File tree

9 files changed

+48
-41
lines changed

9 files changed

+48
-41
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.pwr.students.domain;
2+
3+
public enum AnswerType {
4+
SLIDER,
5+
TEXT,
6+
RADIO,
7+
}

src/main/java/com/pwr/students/domain/Question.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class Question implements Serializable {
2929

3030
@NotNull
3131
@Column(name = "answer_type", nullable = false)
32-
private String answerType;
32+
@Enumerated(EnumType.STRING)
33+
private AnswerType answerType;
3334

3435
@NotNull
3536
@Size(min = 16, max = 255)
@@ -75,16 +76,16 @@ public void setCategory(String category) {
7576
this.category = category;
7677
}
7778

78-
public String getAnswerType() {
79+
public AnswerType getAnswerType() {
7980
return this.answerType;
8081
}
8182

82-
public Question answerType(String answerType) {
83+
public Question answerType(AnswerType answerType) {
8384
this.setAnswerType(answerType);
8485
return this;
8586
}
8687

87-
public void setAnswerType(String answerType) {
88+
public void setAnswerType(AnswerType answerType) {
8889
this.answerType = answerType;
8990
}
9091

src/main/java/com/pwr/students/domain/Survey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.pwr.students.domain;
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4-
import com.pwr.students.repository.SurveyStatus;
54
import jakarta.persistence.*;
65
import jakarta.validation.constraints.*;
76
import java.io.Serializable;

src/main/java/com/pwr/students/repository/SurveyStatus.java renamed to src/main/java/com/pwr/students/domain/SurveyStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.pwr.students.repository;
1+
package com.pwr.students.domain;
22

33
public enum SurveyStatus {
44
DRAFT,
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
id;category;answer_type;question_content;is_required;jhi_order;survey_id
2-
1;attitude;calculate Infrastructure;including Networked;true;44743;1
3-
2;Integration Berkshire up;Rubber;revolutionary above Jazz;true;48233;2
4-
3;Jazz;XML;Classical Chevrolet who;true;75409;3
5-
4;sensor Phased;Engineer firewall Northwest;orchestration Palladium;true;33686;4
6-
5;Account provided;Jersey capacitor Thiel;VanXXXXXXXXXXXXX;true;91402;5
7-
6;strategic lame;since Screen Country;lens Principal CSS;true;73489;6
8-
7;cyan Denver ferociously;Southwest;to SouthXXXXXXXX;true;11450;7
9-
8;Thorium Bowie;bluetooth brr;Soap RubberXXXXX;true;17469;8
10-
9;Forward;grey California;Southeast Bacon Copernicium;false;26648;9
11-
10;Czech New;benchmark invoice Rialto;but Brakus South;true;60643;10
2+
1;attitude;TEXT;including Networked;true;44743;1
3+
2;Integration Berkshire up;RADIO;whatever question content;true;48233;2
4+
3;Jazz;SLIDER;whatever question content;true;75409;3
5+
4;sensor Phased;TEXT;orchestration Palladium;true;33686;4
6+
5;Account provided;TEXT;VanXXXXXXXXXXXXX;true;91402;5
7+
6;strategic lame;TEXT;lens Principal CSS;true;73489;6
8+
7;cyan Denver ferociously;SLIDER;to SouthXXXXXXXX;true;11450;7
9+
8;Thorium Bowie;SLIDER;Soap RubberXXXXX;true;17469;8
10+
9;Forward;RADIO;Southeast Bacon Copernicium;false;26648;9
11+
10;Czech New;RADIO;but Brakus South;true;60643;10
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
id;name;description;deadline;status
2-
1;Division;BMW Pound Zealand;2023-05-09;weber Cheese
3-
2;Auburn platforms;networks Architect;2023-05-10;Lauderhill Bedfordshire Chips
4-
3;orchid;Drive ZirconiumX;2023-05-10;Principal
5-
4;infomediaries Route;that EngineerXXX;2023-05-09;neutral incentivize
6-
5;navigation synthesize next;Analyst matrix Interactions;2023-05-09;frozen Steel
7-
6;backing holistic;Rupiah North Luxurious;2023-05-10;silky
8-
7;neutral;panel consequently Operations;2023-05-10;withdrawal Account
9-
8;Ohio avaricious Cisgender;CambridgeshireXX;2023-05-10;stable Wooden
10-
9;Convertible oh;Hybrid KiaXXXXXX;2023-05-10;Account
11-
10;IP Orland;kilogramXXXXXXXX;2023-05-10;Bicycle Markets
2+
1;Division;BMW Pound Zealand;2023-05-09;ACTIVE
3+
2;Auburn platforms;networks Architect;2023-05-10;ACTIVE
4+
3;orchid;Drive ZirconiumX;2023-05-10;ACTIVE
5+
4;infomediaries Route;that EngineerXXX;2023-05-09;ACTIVE
6+
5;navigation synthesize next;Analyst matrix Interactions;2023-05-09;ACTIVE
7+
6;backing holistic;Rupiah North Luxurious;2023-05-10;EXPIRED
8+
7;neutral;panel consequently Operations;2023-05-10;EXPIRED
9+
8;Ohio avaricious Cisgender;CambridgeshireXX;2023-05-10;EXPIRED
10+
9;Convertible oh;Hybrid KiaXXXXXX;2023-05-10;EXPIRED
11+
10;IP Orland;kilogramXXXXXXXX;2023-05-10;DRAFT
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
id;is_finished
2-
1;true
3-
2;true
4-
3;false
5-
4;true
6-
5;true
7-
6;true
8-
7;false
9-
8;true
10-
9;false
11-
10;true
1+
id;is_finished;survey_id;user_id
2+
1;true;1;1
3+
2;true;2;1
4+
3;false;3;1
5+
4;true;4;1
6+
5;true;5;1
7+
6;true;6;2
8+
7;false;7;2
9+
8;true;8;2
10+
9;false;9;2
11+
10;true;10;2

src/test/java/com/pwr/students/web/rest/QuestionResourceIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
99

1010
import com.pwr.students.IntegrationTest;
11+
import com.pwr.students.domain.AnswerType;
1112
import com.pwr.students.domain.Question;
1213
import com.pwr.students.repository.QuestionRepository;
1314
import jakarta.persistence.EntityManager;
@@ -42,8 +43,8 @@ class QuestionResourceIT {
4243
private static final String DEFAULT_CATEGORY = "AAAAAAAAAA";
4344
private static final String UPDATED_CATEGORY = "BBBBBBBBBB";
4445

45-
private static final String DEFAULT_ANSWER_TYPE = "AAAAAAAAAA";
46-
private static final String UPDATED_ANSWER_TYPE = "BBBBBBBBBB";
46+
private static final AnswerType DEFAULT_ANSWER_TYPE = AnswerType.TEXT;
47+
private static final AnswerType UPDATED_ANSWER_TYPE = AnswerType.RADIO;
4748

4849
private static final String DEFAULT_QUESTION_CONTENT = "AAAAAAAAAAAAAAAA";
4950
private static final String UPDATED_QUESTION_CONTENT = "BBBBBBBBBBBBBBBB";

src/test/java/com/pwr/students/web/rest/SurveyResourceIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import com.pwr.students.IntegrationTest;
1111
import com.pwr.students.domain.Survey;
12+
import com.pwr.students.domain.SurveyStatus;
1213
import com.pwr.students.repository.SurveyRepository;
13-
import com.pwr.students.repository.SurveyStatus;
1414
import jakarta.persistence.EntityManager;
1515
import java.time.LocalDate;
1616
import java.time.ZoneId;
@@ -26,7 +26,6 @@
2626
import org.springframework.beans.factory.annotation.Autowired;
2727
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
2828
import org.springframework.data.domain.PageImpl;
29-
import org.springframework.data.domain.PageRequest;
3029
import org.springframework.data.domain.Pageable;
3130
import org.springframework.http.MediaType;
3231
import org.springframework.security.test.context.support.WithMockUser;

0 commit comments

Comments
 (0)