|
3 | 3 | import static org.junit.Assert.assertEquals; |
4 | 4 | import static org.junit.Assert.assertNotEquals; |
5 | 5 |
|
| 6 | +import java.util.ArrayList; |
| 7 | + |
6 | 8 | import org.junit.After; |
7 | 9 | import org.junit.Before; |
8 | 10 | import org.junit.Test; |
|
15 | 17 | import org.springframework.test.context.ActiveProfiles; |
16 | 18 | import org.springframework.test.context.junit4.SpringRunner; |
17 | 19 |
|
18 | | -import edu.tamu.app.WebServerInit; |
| 20 | +import edu.tamu.app.StatusApplication; |
19 | 21 | import edu.tamu.app.enums.Role; |
20 | 22 | import edu.tamu.app.enums.Status; |
21 | 23 | import edu.tamu.app.exception.UserNotFoundException; |
|
27 | 29 |
|
28 | 30 | @ActiveProfiles("test") |
29 | 31 | @RunWith(SpringRunner.class) |
30 | | -@SpringBootTest(classes = { WebServerInit.class }, webEnvironment = WebEnvironment.DEFINED_PORT) |
| 32 | +@SpringBootTest(classes = { StatusApplication.class }, webEnvironment = WebEnvironment.DEFINED_PORT) |
31 | 33 | public class FeatureProposalTest { |
32 | 34 |
|
33 | 35 | private static final String TEST_FEATURE_PROPOSAL_TITLE = "Feature Proposal Title"; |
@@ -112,8 +114,13 @@ public void testVote() throws UserNotFoundException { |
112 | 114 | public void testVoteDuplicate() throws UserNotFoundException { |
113 | 115 | FeatureProposal newFeatureProposal = featureProposalRepo.create(new FeatureProposal(TEST_ALTERNATIVE_FEATURE_PROPOSAL_TITLE, TEST_ALTERNATIVE_FEATURE_PROPOSAL_DESCRIPTION, testUser, service2), TEST_CREDENTIALS); |
114 | 116 | User testVoter = userRepo.create(TEST_VOTER_CREDENTIALS.getUin(), TEST_VOTER_CREDENTIALS.getEmail(), TEST_VOTER_CREDENTIALS.getFirstName(), TEST_VOTER_CREDENTIALS.getLastName(), Role.valueOf(TEST_VOTER_CREDENTIALS.getRole())); |
115 | | - newFeatureProposal.addVoter(testVoter); |
116 | | - newFeatureProposal.addVoter(testVoter); |
| 117 | + newFeatureProposal.setVoters(new ArrayList<User>() { |
| 118 | + private static final long serialVersionUID = -7900927790649066585L; |
| 119 | + { |
| 120 | + add(testVoter); |
| 121 | + add(testVoter); |
| 122 | + } |
| 123 | + }); |
117 | 124 | newFeatureProposal = featureProposalRepo.save(newFeatureProposal); |
118 | 125 | } |
119 | 126 |
|
|
0 commit comments