/*
 * Copyright 2016 EPAM Systems
 * 
 * 
 * This file is part of EPAM Report Portal.
 * https://github.com/reportportal/commons-model
 * 
 * Report Portal is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Report Portal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Report Portal.  If not, see <http://www.gnu.org/licenses/>.
 */ 
 
package com.epam.ta.reportportal.ws.model;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;

/**
 * Test Item custom serializer test
 * 
 * @author Andrei Varabyeu
 * 
 */
public class StartTestItemSerializerTest {

	private ObjectMapper om = getObjectMapper();

	private static final String START_ITEM_RQ = "{\"description\":\"description\",\"launch_id\":\"some id\",\"type\":\"LAUNCH\"}";

	@Test
	public void testSerializer() throws JsonProcessingException {
		String json = om.writeValueAsString(getStartTestItem());
		Assert.assertEquals("Incorrect serialization result", START_ITEM_RQ, json);
	}

	@Test
	public void testDeserializer() throws IOException {
		StartTestItemRQ rq = om.readValue(START_ITEM_RQ.toLowerCase().getBytes(), StartTestItemRQ.class);
		Assert.assertEquals("Incorrect deserialization result", rq.getType(), "LAUNCH");
	}

	private StartTestItemRQ getStartTestItem() {
		StartTestItemRQ startTestItem = new StartTestItemRQ();
		startTestItem.setDescription("description");
		startTestItem.setLaunchId("some id");
		startTestItem.setType("launch");

		return startTestItem;
	}

	private ObjectMapper getObjectMapper() {
		ObjectMapper om = new ObjectMapper();
		om.configure(SerializationFeature.INDENT_OUTPUT, false);
		return om;
	}
}
@@ -786,19 +786,17 @@
 s/%3E.%0A */
- %0A 
+%0A
 %0Apackage
@@ -1123,17 +1123,16 @@
  test%0A *
- 
 %0A * @aut
@@ -1151,20 +1151,16 @@
 arabyeu%0A
- * %0A
  */%0Apubl
@@ -1370,16 +1370,32 @@
 LAUNCH%5C%22
+,%5C%22rerun%5C%22:false
 %7D%22;%0A%0A%09@T

fix tests