Skip to content

Commit 6a578af

Browse files
author
Lloyd Watkin
committed
Update tests for overrides
1 parent f02e8e7 commit 6a578af

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

configuration.properties.example

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ channels.autosubscribe=lounge@example.com;welcome@example.com
2727
# NOTE: This will only work on local private channels
2828
channels.autosubscribe.autoapprove=false
2929

30-
# Default channels configuration related to access and permissions
31-
channels.default.accessmodel=open
32-
channels.default.role=follower+post
30+
# Channel configuration related to access model and affiliation
31+
32+
channel.configuration.default.accessmodel=open
33+
channel.configuration.default.affiliation=member
34+
35+
# Overrides for default configuration
36+
channel.configuration.posts.affiliation=publisher
37+
38+
channel.configuration.geo.next.accessmodel=authorize
39+
channel.configuration.geo.current.accessmodel=authorize
40+
channel.configuration.geo.previous.accessmodel=authorize

src/main/java/org/buddycloud/channelserver/channel/Conf.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ private static HashMap<String, String> getDefaultConf(JID channelJID, String nod
129129
conf.put(PUBLISH_MODEL, PUBLISHERS);
130130
conf.put(CREATION_DATE, formatDate(new Date()));
131131
conf.put(OWNER, channelJID.toBareJID());
132+
132133
conf.put(ACCESS_MODEL, AccessModels.createFromString(projectConf.getProperty(
133-
Configuration.CONFIGURATION_CHANNELS_DEFAULT_ACCESSMODEL, AccessModels.authorize.toString())).toString());
134+
Configuration.CONFIGURATION_CHANNELS_DEFAULT_ACCESSMODEL, AccessModels.open.toString())).toString());
134135
conf.put(DEFAULT_AFFILIATION, Affiliations.createFromString(
135136
projectConf.getProperty(Configuration.CONFIGURATION_CHANNELS_DEFAULT_AFFILIATION, Affiliations.member.toString()))
136137
.toString());

src/test/java/org/buddycloud/channelserver/channel/ConfTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void testGetDefaultPostChannelConf() {
7070
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
7171
// Date()),result.get(Conf.CREATION_DATE));
7272
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
73-
assertEquals(Affiliations.member.toString(),
73+
assertEquals(Affiliations.publisher.toString(),
7474
result.get(Conf.DEFAULT_AFFILIATION));
7575
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
7676
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
@@ -124,7 +124,7 @@ public void testGetDefaultGeoPreviousChannelConf() {
124124
+ " has been before.", result.get(Conf.DESCRIPTION));
125125
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
126126
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
127-
assertEquals(AccessModels.open.toString(),
127+
assertEquals(AccessModels.authorize.toString(),
128128
result.get(Conf.ACCESS_MODEL));
129129
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
130130
// Date()),result.get(Conf.CREATION_DATE));
@@ -153,7 +153,7 @@ public void testGetDefaultGeoCurrentChannelConf() {
153153
result.get(Conf.DESCRIPTION));
154154
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
155155
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
156-
assertEquals(AccessModels.open.toString(),
156+
assertEquals(AccessModels.authorize.toString(),
157157
result.get(Conf.ACCESS_MODEL));
158158
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
159159
// Date()),result.get(Conf.CREATION_DATE));
@@ -181,7 +181,7 @@ public void testGetDefaultGeoNextChannelConf() {
181181
+ " is going to go.", result.get(Conf.DESCRIPTION));
182182
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
183183
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
184-
assertEquals(AccessModels.open.toString(),
184+
assertEquals(AccessModels.authorize.toString(),
185185
result.get(Conf.ACCESS_MODEL));
186186
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
187187
// Date()),result.get(Conf.CREATION_DATE));

src/test/resources/configuration.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ channels.autosubscribe.autoapprove=true
1919
channel.configuration.default.accessmodel=open
2020
channel.configuration.default.affiliation=member
2121

22-
channel.configuration.posts.accessmodel=publisher
22+
channel.configuration.posts.affiliation=publisher
2323

2424
channel.configuration.geo.next.accessmodel=authorize
2525
channel.configuration.geo.current.accessmodel=authorize

0 commit comments

Comments
 (0)