Renaming tests
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 31 Jan 2017 01:02:10 +0000 (02:02 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Tue, 31 Jan 2017 01:02:10 +0000 (02:02 +0100)
SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverIntegrationTest.java [new file with mode: 0644]
SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverShould.java [deleted file]
SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderIntegrationTest.java [new file with mode: 0644]
SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderShould.java [deleted file]

diff --git a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverIntegrationTest.java b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverIntegrationTest.java
new file mode 100644 (file)
index 0000000..9a01a2d
--- /dev/null
@@ -0,0 +1,45 @@
+package de.example.spring.kafka;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.doNothing;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.cloud.stream.messaging.Sink;
+import org.springframework.messaging.Message;
+import org.springframework.messaging.support.GenericMessage;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(classes = { Receiver.class })
+@DirtiesContext
+public class ReceiverIntegrationTest {
+
+       @Inject
+       Sink source;
+       
+       @MockBean
+       DummyService dummyService;
+       
+       @Test
+       public void callSomeDummy() {
+               String productName = "product";
+               String productDescription = "productDescription";
+               Product product = new Product(productName, productDescription);
+           ArgumentCaptor<String> dummyArgCaptor = ArgumentCaptor.forClass(String.class);
+               doNothing().when(dummyService).iAmVeryDummy(dummyArgCaptor.capture());
+               
+           Message<Product> message = new GenericMessage<>(product);
+           source.input().send(message);
+
+           assertThat(dummyArgCaptor.getValue(), is(product.getName()));
+       }
+
+}
diff --git a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverShould.java b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-consumer/src/test/java/de/example/spring/kafka/ReceiverShould.java
deleted file mode 100644 (file)
index 6291ea4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package de.example.spring.kafka;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.doNothing;
-
-import javax.inject.Inject;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.cloud.stream.messaging.Sink;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest(classes = { Receiver.class })
-@DirtiesContext
-public class ReceiverShould {
-
-       @Inject
-       Sink source;
-       
-       @MockBean
-       DummyService dummyService;
-       
-       @Test
-       public void callSomeDummy() {
-               String productName = "product";
-               String productDescription = "productDescription";
-               Product product = new Product(productName, productDescription);
-           ArgumentCaptor<String> dummyArgCaptor = ArgumentCaptor.forClass(String.class);
-               doNothing().when(dummyService).iAmVeryDummy(dummyArgCaptor.capture());
-               
-           Message<Product> message = new GenericMessage<>(product);
-           source.input().send(message);
-
-           assertThat(dummyArgCaptor.getValue(), is(product.getName()));
-       }
-
-}
diff --git a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderIntegrationTest.java b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderIntegrationTest.java
new file mode 100644 (file)
index 0000000..d424fac
--- /dev/null
@@ -0,0 +1,42 @@
+package de.example.spring.kafka;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.cloud.stream.messaging.Source;
+import org.springframework.cloud.stream.test.binder.MessageCollector;
+import org.springframework.messaging.Message;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@SpringBootTest(classes = { Sender.class })
+@DirtiesContext
+public class SenderIntegrationTest {
+
+       @Inject
+       Source source;
+       
+       @Inject
+       Sender sender;
+       
+       @Inject
+       private MessageCollector messageCollector;
+       
+       @Test
+       public void sendSomeProduct() {
+               Product product = new Product("hello", "this is some description");
+               
+               sender.sendMessage("hello");
+               
+               Message<Product> received = (Message<Product>) messageCollector.forChannel(source.output()).poll();
+               
+           assertThat(received.getPayload().getDescription(), is(product.getDescription()));
+       }
+
+}
diff --git a/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderShould.java b/SpringJava/Kafka/SpringCloudStream/spring-stream-kafka-producer/src/test/java/de/example/spring/kafka/SenderShould.java
deleted file mode 100644 (file)
index 71fbfec..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package de.example.spring.kafka;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import javax.inject.Inject;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.stream.messaging.Source;
-import org.springframework.cloud.stream.test.binder.MessageCollector;
-import org.springframework.messaging.Message;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest(classes = { Sender.class })
-@DirtiesContext
-public class SenderShould {
-
-       @Inject
-       Source source;
-       
-       @Inject
-       Sender sender;
-       
-       @Inject
-       private MessageCollector messageCollector;
-       
-       @Test
-       public void sendSomeProduct() {
-               Product product = new Product("hello", "this is some description");
-               
-               sender.sendMessage("hello");
-               
-               Message<Product> received = (Message<Product>) messageCollector.forChannel(source.output()).poll();
-               
-           assertThat(received.getPayload().getDescription(), is(product.getDescription()));
-       }
-
-}