Example usage for org.springframework.kafka.support.serializer.testentities DummyEntity DummyEntity

List of usage examples for org.springframework.kafka.support.serializer.testentities DummyEntity DummyEntity

Introduction

In this page you can find the example usage for org.springframework.kafka.support.serializer.testentities DummyEntity DummyEntity.

Prototype

DummyEntity

Source Link

Usage

From source file:org.springframework.kafka.support.serializer.JsonSerializationTests.java

@Before
public void init() {
    entity = new DummyEntity();
    entity.intValue = 19;//from w  ww .  j  ava  2s.c o  m
    entity.longValue = 7L;
    entity.stringValue = "dummy";
    List<String> list = Arrays.asList("dummy1", "dummy2");
    entity.complexStruct = new HashMap<>();
    entity.complexStruct.put((short) 4, list);

    topic = "topic-name";

    jsonReader = new JsonDeserializer<DummyEntity>() {
    };
    jsonReader.configure(new HashMap<String, Object>(), false);
    jsonReader.close(); // does nothing, so may be called any time, or not called at all
    jsonWriter = new JsonSerializer<>();
    jsonWriter.configure(new HashMap<String, Object>(), false);
    jsonWriter.close(); // does nothing, so may be called any time, or not called at all
    stringReader = new StringDeserializer();
    stringReader.configure(new HashMap<String, Object>(), false);
    stringWriter = new StringSerializer();
    stringWriter.configure(new HashMap<String, Object>(), false);
}