Browse Source

More fixes on removing unneccessary ids

Lauren Green 5 years ago
parent
commit
faa2d67d7f

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/CohortResourceIntTest.java View File

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

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/EmployerResourceIntTest.java View File

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

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/PostResourceIntTest.java View File

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

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/PrivacyResourceIntTest.java View File

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

+ 0
- 9
src/test/java/rocks/zipcode/io/web/rest/UserProfileResourceIntTest.java View File

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