package com.mobilejazz.cacheio.serializer;

import com.google.gson.Gson;
import com.mobilejazz.cacheio.ApplicationTestCase;
import com.mobilejazz.cacheio.GsonSerialiser;
import com.mobilejazz.cacheio.Serialiser;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;

public class GsonSerialiserTest extends ApplicationTestCase {

  private Serialiser serialiser;

  @Before public void setUp() throws Exception {
    Gson gson = new Gson();
    serialiser = new GsonSerialiser(gson);
  }

  @Test public void shouldPassTest() throws Exception {
    Assertions.assertThat(true).isTrue();
  }
}

@@ -201,24 +201,75 @@
 Serialiser;%0A
+import com.mobilejazz.cacheio.model.UserTestModel;%0A
 import org.a
@@ -296,16 +296,16 @@
 rtions;%0A
-
 import o
@@ -597,77 +597,1216 @@
 ould
-PassTest() throws Exception %7B%0A    Assertions.assertThat(true).isTrue(
+SerialiseAObject() throws Exception %7B%0A    UserTestModel userTestModel = fakeUserTestObject();%0A%0A    byte%5B%5D bytes = serialiser.toBytes(userTestModel);%0A%0A    Assertions.assertThat(bytes).isNotNull();%0A    Assertions.assertThat(bytes.length).isGreaterThan(0);%0A  %7D%0A%0A  @Test public void shouldDeserializeAObject() throws Exception %7B%0A    UserTestModel userTestModelToDeserialize = fakeUserTestObject();%0A    byte%5B%5D userDeserialized = fakeUserTestBytes(userTestModelToDeserialize);%0A%0A    UserTestModel userTestModelExpected =%0A        (UserTestModel) serialiser.fromBytes(userDeserialized, UserTestModel.class);%0A%0A    Assertions.assertThat(userTestModelExpected).isNotNull();%0A    Assertions.assertThat(userTestModelExpected.getId())%0A        .isEqualTo(userTestModelToDeserialize.getId());%0A    Assertions.assertThat(userTestModelExpected.getName())%0A        .isEqualTo(userTestModelToDeserialize.getName());%0A  %7D%0A%0A  private UserTestModel fakeUserTestObject() %7B%0A    UserTestModel userTestModel = new UserTestModel();%0A    userTestModel.setId(1);%0A    userTestModel.setName(%22Test name%22);%0A%0A    return userTestModel;%0A  %7D%0A%0A  private byte%5B%5D fakeUserTestBytes(UserTestModel userTestModel) %7B%0A    return serialiser.toBytes(userTestModel
 );%0A 

Implement test to check that the GsonSerializer is working