Bladeren bron

More fixes on removing unneccessary ids

Lauren Green 5 jaren geleden
bovenliggende
commit
faa2d67d7f

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/CohortResourceIntTest.java Bestand weergeven

@@ -39,9 +39,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
39 39
 @SpringBootTest(classes = ZipConnectApp.class)
40 40
 public class CohortResourceIntTest {
41 41
 
42
-    private static final Double DEFAULT_COHORT_ID = 1D;
43
-    private static final Double UPDATED_COHORT_ID = 2D;
44
-
45 42
     private static final String DEFAULT_GRAD_DATE = "AAAAAAAAAA";
46 43
     private static final String UPDATED_GRAD_DATE = "BBBBBBBBBB";
47 44
 
@@ -83,7 +80,6 @@ public class CohortResourceIntTest {
83 80
      */
84 81
     public static Cohort createEntity(EntityManager em) {
85 82
         Cohort cohort = new Cohort()
86
-            .cohortId(DEFAULT_COHORT_ID)
87 83
             .gradDate(DEFAULT_GRAD_DATE);
88 84
         return cohort;
89 85
     }
@@ -108,7 +104,6 @@ public class CohortResourceIntTest {
108 104
         List<Cohort> cohortList = cohortRepository.findAll();
109 105
         assertThat(cohortList).hasSize(databaseSizeBeforeCreate + 1);
110 106
         Cohort testCohort = cohortList.get(cohortList.size() - 1);
111
-        assertThat(testCohort.getCohortId()).isEqualTo(DEFAULT_COHORT_ID);
112 107
         assertThat(testCohort.getGradDate()).isEqualTo(DEFAULT_GRAD_DATE);
113 108
     }
114 109
 
@@ -142,7 +137,6 @@ public class CohortResourceIntTest {
142 137
             .andExpect(status().isOk())
143 138
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
144 139
             .andExpect(jsonPath("$.[*].id").value(hasItem(cohort.getId().intValue())))
145
-            .andExpect(jsonPath("$.[*].cohortId").value(hasItem(DEFAULT_COHORT_ID.doubleValue())))
146 140
             .andExpect(jsonPath("$.[*].gradDate").value(hasItem(DEFAULT_GRAD_DATE.toString())));
147 141
     }
148 142
     
@@ -157,7 +151,6 @@ public class CohortResourceIntTest {
157 151
             .andExpect(status().isOk())
158 152
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
159 153
             .andExpect(jsonPath("$.id").value(cohort.getId().intValue()))
160
-            .andExpect(jsonPath("$.cohortId").value(DEFAULT_COHORT_ID.doubleValue()))
161 154
             .andExpect(jsonPath("$.gradDate").value(DEFAULT_GRAD_DATE.toString()));
162 155
     }
163 156
 
@@ -182,7 +175,6 @@ public class CohortResourceIntTest {
182 175
         // Disconnect from session so that the updates on updatedCohort are not directly saved in db
183 176
         em.detach(updatedCohort);
184 177
         updatedCohort
185
-            .cohortId(UPDATED_COHORT_ID)
186 178
             .gradDate(UPDATED_GRAD_DATE);
187 179
 
188 180
         restCohortMockMvc.perform(put("/api/cohorts")
@@ -194,7 +186,6 @@ public class CohortResourceIntTest {
194 186
         List<Cohort> cohortList = cohortRepository.findAll();
195 187
         assertThat(cohortList).hasSize(databaseSizeBeforeUpdate);
196 188
         Cohort testCohort = cohortList.get(cohortList.size() - 1);
197
-        assertThat(testCohort.getCohortId()).isEqualTo(UPDATED_COHORT_ID);
198 189
         assertThat(testCohort.getGradDate()).isEqualTo(UPDATED_GRAD_DATE);
199 190
     }
200 191
 

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/EmployerResourceIntTest.java Bestand weergeven

@@ -39,9 +39,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
39 39
 @SpringBootTest(classes = ZipConnectApp.class)
40 40
 public class EmployerResourceIntTest {
41 41
 
42
-    private static final Long DEFAULT_EMPLOYER_ID = 1L;
43
-    private static final Long UPDATED_EMPLOYER_ID = 2L;
44
-
45 42
     private static final String DEFAULT_COMPANY_NAME = "AAAAAAAAAA";
46 43
     private static final String UPDATED_COMPANY_NAME = "BBBBBBBBBB";
47 44
 
@@ -89,7 +86,6 @@ public class EmployerResourceIntTest {
89 86
      */
90 87
     public static Employer createEntity(EntityManager em) {
91 88
         Employer employer = new Employer()
92
-            .employerId(DEFAULT_EMPLOYER_ID)
93 89
             .companyName(DEFAULT_COMPANY_NAME)
94 90
             .city(DEFAULT_CITY)
95 91
             .state(DEFAULT_STATE);
@@ -116,7 +112,6 @@ public class EmployerResourceIntTest {
116 112
         List<Employer> employerList = employerRepository.findAll();
117 113
         assertThat(employerList).hasSize(databaseSizeBeforeCreate + 1);
118 114
         Employer testEmployer = employerList.get(employerList.size() - 1);
119
-        assertThat(testEmployer.getEmployerId()).isEqualTo(DEFAULT_EMPLOYER_ID);
120 115
         assertThat(testEmployer.getCompanyName()).isEqualTo(DEFAULT_COMPANY_NAME);
121 116
         assertThat(testEmployer.getCity()).isEqualTo(DEFAULT_CITY);
122 117
         assertThat(testEmployer.getState()).isEqualTo(DEFAULT_STATE);
@@ -152,7 +147,6 @@ public class EmployerResourceIntTest {
152 147
             .andExpect(status().isOk())
153 148
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
154 149
             .andExpect(jsonPath("$.[*].id").value(hasItem(employer.getId().intValue())))
155
-            .andExpect(jsonPath("$.[*].employerId").value(hasItem(DEFAULT_EMPLOYER_ID.intValue())))
156 150
             .andExpect(jsonPath("$.[*].companyName").value(hasItem(DEFAULT_COMPANY_NAME.toString())))
157 151
             .andExpect(jsonPath("$.[*].city").value(hasItem(DEFAULT_CITY.toString())))
158 152
             .andExpect(jsonPath("$.[*].state").value(hasItem(DEFAULT_STATE.toString())));
@@ -169,7 +163,6 @@ public class EmployerResourceIntTest {
169 163
             .andExpect(status().isOk())
170 164
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
171 165
             .andExpect(jsonPath("$.id").value(employer.getId().intValue()))
172
-            .andExpect(jsonPath("$.employerId").value(DEFAULT_EMPLOYER_ID.intValue()))
173 166
             .andExpect(jsonPath("$.companyName").value(DEFAULT_COMPANY_NAME.toString()))
174 167
             .andExpect(jsonPath("$.city").value(DEFAULT_CITY.toString()))
175 168
             .andExpect(jsonPath("$.state").value(DEFAULT_STATE.toString()));
@@ -196,7 +189,6 @@ public class EmployerResourceIntTest {
196 189
         // Disconnect from session so that the updates on updatedEmployer are not directly saved in db
197 190
         em.detach(updatedEmployer);
198 191
         updatedEmployer
199
-            .employerId(UPDATED_EMPLOYER_ID)
200 192
             .companyName(UPDATED_COMPANY_NAME)
201 193
             .city(UPDATED_CITY)
202 194
             .state(UPDATED_STATE);
@@ -210,7 +202,6 @@ public class EmployerResourceIntTest {
210 202
         List<Employer> employerList = employerRepository.findAll();
211 203
         assertThat(employerList).hasSize(databaseSizeBeforeUpdate);
212 204
         Employer testEmployer = employerList.get(employerList.size() - 1);
213
-        assertThat(testEmployer.getEmployerId()).isEqualTo(UPDATED_EMPLOYER_ID);
214 205
         assertThat(testEmployer.getCompanyName()).isEqualTo(UPDATED_COMPANY_NAME);
215 206
         assertThat(testEmployer.getCity()).isEqualTo(UPDATED_CITY);
216 207
         assertThat(testEmployer.getState()).isEqualTo(UPDATED_STATE);

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/PostResourceIntTest.java Bestand weergeven

@@ -41,9 +41,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
41 41
 @SpringBootTest(classes = ZipConnectApp.class)
42 42
 public class PostResourceIntTest {
43 43
 
44
-    private static final Long DEFAULT_POST_ID = 1L;
45
-    private static final Long UPDATED_POST_ID = 2L;
46
-
47 44
     private static final LocalDate DEFAULT_TIMESTAMP = LocalDate.ofEpochDay(0L);
48 45
     private static final LocalDate UPDATED_TIMESTAMP = LocalDate.now(ZoneId.systemDefault());
49 46
 
@@ -91,7 +88,6 @@ public class PostResourceIntTest {
91 88
      */
92 89
     public static Post createEntity(EntityManager em) {
93 90
         Post post = new Post()
94
-            .postId(DEFAULT_POST_ID)
95 91
             .timestamp(DEFAULT_TIMESTAMP)
96 92
             .content(DEFAULT_CONTENT)
97 93
             .likes(DEFAULT_LIKES);
@@ -118,7 +114,6 @@ public class PostResourceIntTest {
118 114
         List<Post> postList = postRepository.findAll();
119 115
         assertThat(postList).hasSize(databaseSizeBeforeCreate + 1);
120 116
         Post testPost = postList.get(postList.size() - 1);
121
-        assertThat(testPost.getPostId()).isEqualTo(DEFAULT_POST_ID);
122 117
         assertThat(testPost.getTimestamp()).isEqualTo(DEFAULT_TIMESTAMP);
123 118
         assertThat(testPost.getContent()).isEqualTo(DEFAULT_CONTENT);
124 119
         assertThat(testPost.getLikes()).isEqualTo(DEFAULT_LIKES);
@@ -154,7 +149,6 @@ public class PostResourceIntTest {
154 149
             .andExpect(status().isOk())
155 150
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
156 151
             .andExpect(jsonPath("$.[*].id").value(hasItem(post.getId().intValue())))
157
-            .andExpect(jsonPath("$.[*].postId").value(hasItem(DEFAULT_POST_ID.intValue())))
158 152
             .andExpect(jsonPath("$.[*].timestamp").value(hasItem(DEFAULT_TIMESTAMP.toString())))
159 153
             .andExpect(jsonPath("$.[*].content").value(hasItem(DEFAULT_CONTENT.toString())))
160 154
             .andExpect(jsonPath("$.[*].likes").value(hasItem(DEFAULT_LIKES.toString())));
@@ -171,7 +165,6 @@ public class PostResourceIntTest {
171 165
             .andExpect(status().isOk())
172 166
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
173 167
             .andExpect(jsonPath("$.id").value(post.getId().intValue()))
174
-            .andExpect(jsonPath("$.postId").value(DEFAULT_POST_ID.intValue()))
175 168
             .andExpect(jsonPath("$.timestamp").value(DEFAULT_TIMESTAMP.toString()))
176 169
             .andExpect(jsonPath("$.content").value(DEFAULT_CONTENT.toString()))
177 170
             .andExpect(jsonPath("$.likes").value(DEFAULT_LIKES.toString()));
@@ -198,7 +191,6 @@ public class PostResourceIntTest {
198 191
         // Disconnect from session so that the updates on updatedPost are not directly saved in db
199 192
         em.detach(updatedPost);
200 193
         updatedPost
201
-            .postId(UPDATED_POST_ID)
202 194
             .timestamp(UPDATED_TIMESTAMP)
203 195
             .content(UPDATED_CONTENT)
204 196
             .likes(UPDATED_LIKES);
@@ -212,7 +204,6 @@ public class PostResourceIntTest {
212 204
         List<Post> postList = postRepository.findAll();
213 205
         assertThat(postList).hasSize(databaseSizeBeforeUpdate);
214 206
         Post testPost = postList.get(postList.size() - 1);
215
-        assertThat(testPost.getPostId()).isEqualTo(UPDATED_POST_ID);
216 207
         assertThat(testPost.getTimestamp()).isEqualTo(UPDATED_TIMESTAMP);
217 208
         assertThat(testPost.getContent()).isEqualTo(UPDATED_CONTENT);
218 209
         assertThat(testPost.getLikes()).isEqualTo(UPDATED_LIKES);

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/PrivacyResourceIntTest.java Bestand weergeven

@@ -39,9 +39,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
39 39
 @SpringBootTest(classes = ZipConnectApp.class)
40 40
 public class PrivacyResourceIntTest {
41 41
 
42
-    private static final Long DEFAULT_PRIVACY_ID = 1L;
43
-    private static final Long UPDATED_PRIVACY_ID = 2L;
44
-
45 42
     private static final Boolean DEFAULT_PUBLIC_VIEW = false;
46 43
     private static final Boolean UPDATED_PUBLIC_VIEW = true;
47 44
 
@@ -89,7 +86,6 @@ public class PrivacyResourceIntTest {
89 86
      */
90 87
     public static Privacy createEntity(EntityManager em) {
91 88
         Privacy privacy = new Privacy()
92
-            .privacyId(DEFAULT_PRIVACY_ID)
93 89
             .publicView(DEFAULT_PUBLIC_VIEW)
94 90
             .cohortView(DEFAULT_COHORT_VIEW)
95 91
             .employerView(DEFAULT_EMPLOYER_VIEW);
@@ -116,7 +112,6 @@ public class PrivacyResourceIntTest {
116 112
         List<Privacy> privacyList = privacyRepository.findAll();
117 113
         assertThat(privacyList).hasSize(databaseSizeBeforeCreate + 1);
118 114
         Privacy testPrivacy = privacyList.get(privacyList.size() - 1);
119
-        assertThat(testPrivacy.getPrivacyId()).isEqualTo(DEFAULT_PRIVACY_ID);
120 115
         assertThat(testPrivacy.isPublicView()).isEqualTo(DEFAULT_PUBLIC_VIEW);
121 116
         assertThat(testPrivacy.isCohortView()).isEqualTo(DEFAULT_COHORT_VIEW);
122 117
         assertThat(testPrivacy.isEmployerView()).isEqualTo(DEFAULT_EMPLOYER_VIEW);
@@ -152,7 +147,6 @@ public class PrivacyResourceIntTest {
152 147
             .andExpect(status().isOk())
153 148
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
154 149
             .andExpect(jsonPath("$.[*].id").value(hasItem(privacy.getId().intValue())))
155
-            .andExpect(jsonPath("$.[*].privacyId").value(hasItem(DEFAULT_PRIVACY_ID.intValue())))
156 150
             .andExpect(jsonPath("$.[*].publicView").value(hasItem(DEFAULT_PUBLIC_VIEW.booleanValue())))
157 151
             .andExpect(jsonPath("$.[*].cohortView").value(hasItem(DEFAULT_COHORT_VIEW.booleanValue())))
158 152
             .andExpect(jsonPath("$.[*].employerView").value(hasItem(DEFAULT_EMPLOYER_VIEW.booleanValue())));
@@ -169,7 +163,6 @@ public class PrivacyResourceIntTest {
169 163
             .andExpect(status().isOk())
170 164
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
171 165
             .andExpect(jsonPath("$.id").value(privacy.getId().intValue()))
172
-            .andExpect(jsonPath("$.privacyId").value(DEFAULT_PRIVACY_ID.intValue()))
173 166
             .andExpect(jsonPath("$.publicView").value(DEFAULT_PUBLIC_VIEW.booleanValue()))
174 167
             .andExpect(jsonPath("$.cohortView").value(DEFAULT_COHORT_VIEW.booleanValue()))
175 168
             .andExpect(jsonPath("$.employerView").value(DEFAULT_EMPLOYER_VIEW.booleanValue()));
@@ -196,7 +189,6 @@ public class PrivacyResourceIntTest {
196 189
         // Disconnect from session so that the updates on updatedPrivacy are not directly saved in db
197 190
         em.detach(updatedPrivacy);
198 191
         updatedPrivacy
199
-            .privacyId(UPDATED_PRIVACY_ID)
200 192
             .publicView(UPDATED_PUBLIC_VIEW)
201 193
             .cohortView(UPDATED_COHORT_VIEW)
202 194
             .employerView(UPDATED_EMPLOYER_VIEW);
@@ -210,7 +202,6 @@ public class PrivacyResourceIntTest {
210 202
         List<Privacy> privacyList = privacyRepository.findAll();
211 203
         assertThat(privacyList).hasSize(databaseSizeBeforeUpdate);
212 204
         Privacy testPrivacy = privacyList.get(privacyList.size() - 1);
213
-        assertThat(testPrivacy.getPrivacyId()).isEqualTo(UPDATED_PRIVACY_ID);
214 205
         assertThat(testPrivacy.isPublicView()).isEqualTo(UPDATED_PUBLIC_VIEW);
215 206
         assertThat(testPrivacy.isCohortView()).isEqualTo(UPDATED_COHORT_VIEW);
216 207
         assertThat(testPrivacy.isEmployerView()).isEqualTo(UPDATED_EMPLOYER_VIEW);

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/UserProfileResourceIntTest.java Bestand weergeven

@@ -39,9 +39,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
39 39
 @SpringBootTest(classes = ZipConnectApp.class)
40 40
 public class UserProfileResourceIntTest {
41 41
 
42
-    private static final Long DEFAULT_PROFILE_ID = 1L;
43
-    private static final Long UPDATED_PROFILE_ID = 2L;
44
-
45 42
     private static final String DEFAULT_FIRST_NAME = "AAAAAAAAAA";
46 43
     private static final String UPDATED_FIRST_NAME = "BBBBBBBBBB";
47 44
 
@@ -89,7 +86,6 @@ public class UserProfileResourceIntTest {
89 86
      */
90 87
     public static UserProfile createEntity(EntityManager em) {
91 88
         UserProfile userProfile = new UserProfile()
92
-            .profileId(DEFAULT_PROFILE_ID)
93 89
             .firstName(DEFAULT_FIRST_NAME)
94 90
             .lastName(DEFAULT_LAST_NAME)
95 91
             .userStack(DEFAULT_USER_STACK);
@@ -116,7 +112,6 @@ public class UserProfileResourceIntTest {
116 112
         List<UserProfile> userProfileList = userProfileRepository.findAll();
117 113
         assertThat(userProfileList).hasSize(databaseSizeBeforeCreate + 1);
118 114
         UserProfile testUserProfile = userProfileList.get(userProfileList.size() - 1);
119
-        assertThat(testUserProfile.getProfileId()).isEqualTo(DEFAULT_PROFILE_ID);
120 115
         assertThat(testUserProfile.getFirstName()).isEqualTo(DEFAULT_FIRST_NAME);
121 116
         assertThat(testUserProfile.getLastName()).isEqualTo(DEFAULT_LAST_NAME);
122 117
         assertThat(testUserProfile.getUserStack()).isEqualTo(DEFAULT_USER_STACK);
@@ -152,7 +147,6 @@ public class UserProfileResourceIntTest {
152 147
             .andExpect(status().isOk())
153 148
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
154 149
             .andExpect(jsonPath("$.[*].id").value(hasItem(userProfile.getId().intValue())))
155
-            .andExpect(jsonPath("$.[*].profileId").value(hasItem(DEFAULT_PROFILE_ID.intValue())))
156 150
             .andExpect(jsonPath("$.[*].firstName").value(hasItem(DEFAULT_FIRST_NAME.toString())))
157 151
             .andExpect(jsonPath("$.[*].lastName").value(hasItem(DEFAULT_LAST_NAME.toString())))
158 152
             .andExpect(jsonPath("$.[*].userStack").value(hasItem(DEFAULT_USER_STACK.toString())));
@@ -169,7 +163,6 @@ public class UserProfileResourceIntTest {
169 163
             .andExpect(status().isOk())
170 164
             .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
171 165
             .andExpect(jsonPath("$.id").value(userProfile.getId().intValue()))
172
-            .andExpect(jsonPath("$.profileId").value(DEFAULT_PROFILE_ID.intValue()))
173 166
             .andExpect(jsonPath("$.firstName").value(DEFAULT_FIRST_NAME.toString()))
174 167
             .andExpect(jsonPath("$.lastName").value(DEFAULT_LAST_NAME.toString()))
175 168
             .andExpect(jsonPath("$.userStack").value(DEFAULT_USER_STACK.toString()));
@@ -196,7 +189,6 @@ public class UserProfileResourceIntTest {
196 189
         // Disconnect from session so that the updates on updatedUserProfile are not directly saved in db
197 190
         em.detach(updatedUserProfile);
198 191
         updatedUserProfile
199
-            .profileId(UPDATED_PROFILE_ID)
200 192
             .firstName(UPDATED_FIRST_NAME)
201 193
             .lastName(UPDATED_LAST_NAME)
202 194
             .userStack(UPDATED_USER_STACK);
@@ -210,7 +202,6 @@ public class UserProfileResourceIntTest {
210 202
         List<UserProfile> userProfileList = userProfileRepository.findAll();
211 203
         assertThat(userProfileList).hasSize(databaseSizeBeforeUpdate);
212 204
         UserProfile testUserProfile = userProfileList.get(userProfileList.size() - 1);
213
-        assertThat(testUserProfile.getProfileId()).isEqualTo(UPDATED_PROFILE_ID);
214 205
         assertThat(testUserProfile.getFirstName()).isEqualTo(UPDATED_FIRST_NAME);
215 206
         assertThat(testUserProfile.getLastName()).isEqualTo(UPDATED_LAST_NAME);
216 207
         assertThat(testUserProfile.getUserStack()).isEqualTo(UPDATED_USER_STACK);