Ignore:
Timestamp:
09/22/20 16:26:36 (4 years ago)
Author:
bart
Message:

Minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • events/src/test/java/actions/VoteTest.java

    r21 r22  
    66import java.util.Arrays;
    77import java.util.HashMap;
    8 import java.util.LinkedList;
    98import java.util.List;
    109import java.util.Map;
     
    3938        private final static Value VALUE2 = new NumberValue("10");
    4039        // issue 2 is NUMBER and thus serializes with leading '='
    41         private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1}}";
     40        private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1,\"maxPower\":2}}";
    4241
    43         private static Vote vote1, vote1a, vote2, vote3, vote4;
     42        private static Vote vote1, vote1a, vote2, vote3, vote4, vote5;
    4443
    4544        static {
     
    4746                issuevalues.put(ISSUE2, VALUE2);
    4847                bid = new Bid(issuevalues);
    49                 vote1 = new Vote(id, bid, 1);
    50                 vote1a = new Vote(id, bid, 1);
     48                vote1 = new Vote(id, bid, 1, 2);
     49                vote1a = new Vote(id, bid, 1, 2);
    5150
    52                 vote2 = new Vote(id2, bid, 1);
     51                vote2 = new Vote(id2, bid, 1, 2);
    5352
    5453                // values swapped, so different issuevalues.
     
    5655                issuevaluesb.put(ISSUE2, VALUE2);
    5756                bidb = new Bid(issuevaluesb);
    58                 vote3 = new Vote(id, bidb, 1);
     57                vote3 = new Vote(id, bidb, 1, 2);
    5958
    60                 vote4 = new Vote(id, bid, 2);
     59                vote4 = new Vote(id, bid, 2, 2);
     60                vote5 = new Vote(id, bid, 1, 3);
    6161
    6262        }
     
    6464        @Override
    6565        public List<List<Vote>> getGeneralTestData() {
    66                 List<List<Vote>> list = new LinkedList<>();
    67                 list.add(Arrays.asList(vote1, vote1a));
    68                 list.add(Arrays.asList(vote2));
    69                 list.add(Arrays.asList(vote3));
    70                 list.add(Arrays.asList(vote4));
    71                 return list;
     66                return Arrays.asList(Arrays.asList(vote1, vote1a), Arrays.asList(vote2),
     67                                Arrays.asList(vote3), Arrays.asList(vote4),
     68                                Arrays.asList(vote5));
    7269        }
    7370
    7471        @Override
    7572        public List<String> getGeneralTestStrings() {
    76                 return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*",
    77                                 "Vote.*party2.*issue2=10.*issue1=.value1.*1.*",
    78                                 "Vote.*party1.*issue2=10.*issue1=10.*1.*",
    79                                 "Vote.*party1.*issue2=10.*issue1=.value1.*2.*");
     73                return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*2.*",
     74                                "Vote.*party2.*issue2=10.*issue1=.value1.*1.*2.*",
     75                                "Vote.*party1.*issue2=10.*issue1=10.*1.*2.*",
     76                                "Vote.*party1.*issue2=10.*issue1=.value1.*2.*2.*",
     77                                "Vote.*party1.*issue2=10.*issue1=.value1.*1.*3.*");
    8078        }
    8179
Note: See TracChangeset for help on using the changeset viewer.