package de.juplo.kafka;
import com.jayway.jsonpath.JsonPath;
+import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@EmbeddedKafka(topics = TOPIC, partitions = NUM_PARTITIONS)
public class ApplicationTests
{
+ @DisplayName("Application startup")
@Test
public void testApplicationStartup()
{
assertThat(JsonPath.parse(response.getBody()).read("$.status", String.class)).isEqualTo("UP");
}
+ @DisplayName("Not yet existing offset")
+ @Test
+ void testNotYetExistingOffset()
+ {
+ ResponseEntity<String> response = restTemplate.getForEntity("/1/66666666666", String.class);
+ assertThat(response.getStatusCode()).isEqualTo(HttpStatusCode.valueOf(HttpStatus.NOT_FOUND.value()));
+ }
+
static final String TOPIC = "ExampleConsumerTest_TEST";
static final int NUM_PARTITIONS = 7;