Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
support policy commands and responses in DittoProtocolAdapter (wip)
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
  • Loading branch information
dguggemos committed Nov 19, 2019
1 parent 5323123 commit fec43fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -499,8 +499,7 @@ public static Iterable<PolicyEntry> newPolicyEntries(final JsonObject jsonObject
checkNotNull(jsonObject, "JSON object");
return jsonObject.stream()
.map(jsonField -> newPolicyEntry(jsonField.getKey(), jsonField.getValue()))
// TODO changed this to toList from toSet (to fix equals)
.collect(Collectors.toList());
.collect(Collectors.toSet());
}

/**
Expand Down
Expand Up @@ -16,6 +16,7 @@
import static java.util.Collections.singletonList;

import java.util.Arrays;
import java.util.HashSet;
import java.util.UUID;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -199,9 +200,9 @@ static class Policies {
PolicyEntry.newInstance(POLICY_ENTRY_LABEL, Arrays.asList(SUBJECT1, SUBJECT2),
Arrays.asList(RESOURCE1, RESOURCE2));
static final PolicyEntry POLICY_ENTRY2 =
PolicyEntry.newInstance(POLICY_ENTRY_LABEL2, Arrays.asList(SUBJECT1), Arrays.asList(RESOURCE2));
PolicyEntry.newInstance(POLICY_ENTRY_LABEL2, singletonList(SUBJECT1), singletonList(RESOURCE2));

static final Iterable<PolicyEntry> POLICY_ENTRIES = Arrays.asList(POLICY_ENTRY, POLICY_ENTRY2);
static final Iterable<PolicyEntry> POLICY_ENTRIES = new HashSet<>(Arrays.asList(POLICY_ENTRY, POLICY_ENTRY2));
static final Resources RESOURCES = Resources.newInstance(RESOURCE1, RESOURCE2);
static final Subjects SUBJECTS = Subjects.newInstance(SUBJECT1, SUBJECT2);

Expand Down

0 comments on commit fec43fd

Please sign in to comment.