@Test
  public void testDeserializeSystemStreamPartition() throws IOException {
    ObjectMapper objectMapper = new ObjectMapper();

    // case 1: keyBucket not explicitly mentioned
    ObjectNode sspJson = objectMapper.createObjectNode();
    sspJson.put("system", "foo");
    sspJson.put("stream", "bar");
    sspJson.put("partition", 1);

    SystemStreamPartition ssp = new SystemStreamPartition("foo", "bar", new Partition(1));
    String jsonString = new ObjectMapper().writeValueAsString(sspJson);
    SystemStreamPartition deserSSP = this.samzaObjectMapper.readValue(jsonString, SystemStreamPartition.class);

    assertEquals(ssp, deserSSP);

    // case 2: explicitly set key bucket
    sspJson = objectMapper.createObjectNode();
    sspJson.put("system", "foo");
    sspJson.put("stream", "bar");
    sspJson.put("partition", 1);
    sspJson.put("keyBucket", 1);

    ssp = new SystemStreamPartition("foo", "bar", new Partition(1), 1);
    jsonString = new ObjectMapper().writeValueAsString(sspJson);
    deserSSP = this.samzaObjectMapper.readValue(jsonString, SystemStreamPartition.class);

    assertEquals(ssp, deserSSP);
  }
Given a {@link ContainerModel} JSON with only an "id" field, deserialization should fail.
This verifies that even though {@link ContainerModel} has a getId method, the "id" field is not used, since
"processor-id" is the field that is supposed to be used.
samza-core/src/test/java/org/apache/samza/serializers/model/TestSamzaObjectMapper.java