Created
July 15, 2016 12:45
-
-
Save butzopower/4cd99c0c720ffac9689004424402d2d0 to your computer and use it in GitHub Desktop.
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
// example application.properties | |
// spring.cloud.stream.bindings.input.destination=unenriched | |
// spring.cloud.stream.bindings.input.group=default | |
// spring.cloud.stream.bindings.output.destination=enriched | |
// spring.cloud.stream.bindings.output.group=default | |
// spring.cloud.stream.bindings.output.content-type=application/json | |
@RunWith(SpringJUnit4ClassRunner.class) | |
@SpringApplicationConfiguration(classes = com.example.EnricherApplication.class) | |
@IntegrationTest() | |
public class EnricherTest { | |
@Autowired | |
TestMessageBroker testMessageBroker; | |
@Before | |
public void setUp() throws Exception { | |
testMessageBroker.purgeAll(); | |
} | |
@Test | |
public void messageGetsEnrichedWithMyCoolField() throws Exception { | |
testMessageBroker.forTopic("unenriched.default").send("{\"foo\":\"bar\"}"); | |
String result = testMessageBroker.forTopic("enriched.default").poll(); | |
assertEquals(result, "{\"foo\":\"bar\",\"myCoolField\":12345}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment