Skip to content

Commit c540a89

Browse files
committed
fixed feature proposal test
1 parent e365b17 commit c540a89

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/test/java/edu/tamu/app/model/FeatureProposalTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import static org.junit.Assert.assertEquals;
44
import static org.junit.Assert.assertNotEquals;
55

6+
import java.util.ArrayList;
7+
68
import org.junit.After;
79
import org.junit.Before;
810
import org.junit.Test;
@@ -112,8 +114,13 @@ public void testVote() throws UserNotFoundException {
112114
public void testVoteDuplicate() throws UserNotFoundException {
113115
FeatureProposal newFeatureProposal = featureProposalRepo.create(new FeatureProposal(TEST_ALTERNATIVE_FEATURE_PROPOSAL_TITLE, TEST_ALTERNATIVE_FEATURE_PROPOSAL_DESCRIPTION, testUser, service2), TEST_CREDENTIALS);
114116
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+
});
117124
newFeatureProposal = featureProposalRepo.save(newFeatureProposal);
118125
}
119126

0 commit comments

Comments
 (0)