-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from tokensmith/release-1.2.2
Release 1.2.2
- Loading branch information
Showing
9 changed files
with
121 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
|
||
public interface Publish { | ||
void send(String topic, Map<String, String> msg); | ||
void close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package helper; | ||
|
||
import net.tokensmith.pelican.config.PelicanAppConfig; | ||
|
||
import java.util.Properties; | ||
|
||
public class PubSubConfig extends PelicanAppConfig { | ||
|
||
@Override | ||
public Properties propertiesForSubscribe(String clientId, String consumerGroup) { | ||
Properties properties = super.propertiesForSubscribe(clientId, consumerGroup); | ||
properties.put("my.new.prop.key", "my.new.prop.value"); | ||
return properties; | ||
} | ||
|
||
@Override | ||
public Properties propertiesForPublish(String clientId) { | ||
Properties properties = super.propertiesForPublish(clientId); | ||
properties.put("my.new.prop.key", "my.new.prop.value"); | ||
return properties; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/test/java/net/tokensmith/pelican/config/PelicanAppConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.tokensmith.pelican.config; | ||
|
||
|
||
import helper.PubSubConfig; | ||
import org.junit.Test; | ||
|
||
import java.util.Properties; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class PelicanAppConfigTest { | ||
|
||
public PelicanAppConfig subject() { | ||
return new PelicanAppConfig(); | ||
} | ||
|
||
@Test | ||
public void setMessageQueueHostShouldAssign() { | ||
PelicanAppConfig subject = subject(); | ||
subject.setMessageQueueHost("localhost:1234"); | ||
assertThat(subject.messageQueueHost(), is("localhost:1234")); | ||
} | ||
|
||
@Test | ||
public void canOverridePropertiesForPublish() { | ||
PubSubConfig subject = new PubSubConfig(); | ||
Properties actual = subject.propertiesForPublish("clientId"); | ||
assertThat(actual.get("my.new.prop.key"), is("my.new.prop.value")); | ||
} | ||
|
||
@Test | ||
public void canOverridePropertiesForSubscribe() { | ||
PubSubConfig subject = new PubSubConfig(); | ||
Properties actual = subject.propertiesForSubscribe("clientId", "consumerGroup"); | ||
assertThat(actual.get("my.new.prop.key"), is("my.new.prop.value")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters