package org.lla_private.rest.satz;

import javax.ws.rs.core.Response;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.lla_private.bean.request.TextRequestDTO;
import org.lla_private.bean.request.TextRequestDTO.Sentence;
import org.lla_private.rest.json.mapper.IObjectMapperService;
import org.lla_private.service.IManipulationMethodCaller;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class TestAbfrage {

	@Mock
	private IObjectMapperService objectMapperService;

	@Mock
	private IManipulationMethodCaller manipulationMethodCaller;

	@InjectMocks
	private Abfrage abfrageSUT;

	@Test
	public void testManipulation() throws IllegalArgumentException, InterruptedException {
		// TODO: Test berichtigen
		//	Mockito.when(objectMapperService.createJsonString(Mockito.any())).thenReturn("a json string");
		TextRequestDTO mock = Mockito.mock(TextRequestDTO.class);
		Mockito.when(objectMapperService.createObject(Mockito.anyString(), Mockito.any())).thenReturn(mock);

		Sentence sentence = Mockito.mock(Sentence.class);
		Mockito.when(sentence.getSentence()).thenReturn("satz");
		Mockito.when(mock.getSentence()).thenReturn(sentence);

		String json = "json String";
		// TODO: fertig machen!
		//		Response response = abfrageSUT.satzManipulieren(json);

		//	System.out.println(value);
//		Assert.assertEquals(200, response.getStatus());

	}
}

@@ -1263,50 +1263,226 @@
 hen(
-mock.getSentence()).thenReturn(sentence);%0A
+sentence.getSentenceMethod()).thenReturn(%22converter%22);%0A%09%09Mockito.when(mock.getSentence()).thenReturn(sentence);%0A%0A%09%09Mockito.when(manipulationMethodCaller.callAlgorithm(%22converter%22, %22satz%22)).thenReturn(%22converted satz%22);
 %0A%09%09S
@@ -1535,20 +1535,16 @@
 machen!%0A
-%09%09//
 %09%09Respon
@@ -1593,20 +1593,19 @@
 json);%0A%0A
-%09%09
 //
+%09
 %09System.
@@ -1620,18 +1620,31 @@
 tln(
-value
+response.getStatus()
 );%0A
-//
 %09%09As

Test berichtigt