Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.rulez.demokracia.pdengine;

import java.util.ArrayList;
import java.util.List;

public class FakeADAAssuranceProvider {

public FakeADAAssuranceProvider() {
}

public List<String> getassurancesFor(String proxyId) {
List<String> assurances = new ArrayList<String>();
assurances.add("TestAssurances");

return assurances;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.rulez.demokracia.pdengine;

import java.util.List;

import javax.xml.ws.WebServiceContext;

import org.hibernate.Session;
Expand Down Expand Up @@ -27,10 +29,8 @@ public boolean hasAssurance(final String role) {
return getWsContext().isUserInRole(role);
}

public User getWsUser(final String proxyId) {
User user = new User(proxyId);
user.assurances.add("TestAssurances");
return user;
public List<String> getAssurances() {
return new FakeADAAssuranceProvider().getassurancesFor(getWsUserName());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public CastVote castVote(final String voteId, final String ballot, final List<Ra

if (vote.getParameters().canUpdate) {
String proxyId = getWsUserName();
receipt = vote.addCastVote(proxyId, theVote, getWsUser(proxyId).getAssurances());
receipt = vote.addCastVote(proxyId, theVote, getAssurances());
} else {
receipt = vote.addCastVote(null, theVote);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package org.rulez.demokracia.pdengine;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.rulez.demokracia.pdengine.annotations.TestedBehaviour;
import org.rulez.demokracia.pdengine.annotations.TestedFeature;
import org.rulez.demokracia.pdengine.annotations.TestedOperation;
import org.rulez.demokracia.pdengine.testhelpers.CreatedDefaultChoice;
import org.rulez.demokracia.testhelpers.ThrowableTester;

@TestedFeature("Unimplemented")
@TestedOperation("Unimplemented")
@TestedBehaviour("Unimplemented")
public class UnimplementedTests extends CreatedDefaultChoice {
public class UnimplementedTests extends ThrowableTester {

// @Test
// public void the_calculateWinners_method_is_not_implemented_yet() {
// assertUnimplemented(() -> new WinnerCalculatorImpl().calculateWinners(null));
// public void the_getAssurances_method_is_not_implemented_yet() {
// assertUnimplemented(() -> new CastVote("proxyId", new ArrayList<>()).getAssurances());
// }
}