package de.springbootbuch.reactive.filmstore;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.MOCK;
import static org.springframework.http.MediaType.TEXT_EVENT_STREAM;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.FluxExchangeResult;
import org.springframework.test.web.reactive.server.WebTestClient;
import reactor.test.StepVerifier;

/**
 * Part of springbootbuch.de.
 * 
 * @author Michael J. Simons
 * @author @rotnroll666
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = MOCK)
@AutoConfigureWebTestClient
public class FilmRestControllerTest {
	
	@Autowired
	private WebTestClient client;
	
	@Test
	public void testSomeMethod() {
		FluxExchangeResult<Film> result = this.client.get()
				.uri("/api/films")
				.accept(TEXT_EVENT_STREAM)
				.exchange()
				.expectStatus().isOk()
				.expectHeader().contentType(TEXT_EVENT_STREAM)
				.returnResult(Film.class);

		StepVerifier.create(result.getResponseBody())
				.consumeNextWith(person -> assertThat(person.getTitle(), is(equalTo("ACADEMY DINOSAUR"))))
				.expectNextCount(9)
				.expectComplete()
				.verify();
	}
	
}

@@ -1435,16 +1435,20 @@
 eBody())
+%09%09%09%09
 %0A%09%09%09%09.co
@@ -1461,22 +1461,20 @@
 extWith(
-person
+film
  -%3E asse
@@ -1484,14 +1484,12 @@
 hat(
-person
+film
 .get

Fix variable names