// Path: src/test/java/com/hubspot/jackson/datatype/protobuf/util/ObjectMapperHelper.java
// public static ObjectMapper camelCase() {
//   return DEFAULT;
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hubspot.jackson.datatype.protobuf.util.TestProtobuf.AllFields;
import org.junit.Test;
import static com.hubspot.jackson.datatype.protobuf.util.ObjectMapperHelper.camelCase;
import static org.assertj.core.api.Assertions.assertThat;
package com.hubspot.jackson.datatype.protobuf;



public class ReadUnknownEnumValuesAsNullTest {

  @Test
  public void testStringEnabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(true);

    AllFields parsed = mapper.treeToValue(buildNode("fakeValue"), AllFields.class);
    assertThat(parsed.hasEnum()).isFalse();
  }

  @Test(expected = JsonMappingException.class)
  public void testStringDisabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(false);

    mapper.treeToValue(buildNode("fakeValue"), AllFields.class);
  }

  @Test
  public void testIntEnabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(true);

    AllFields parsed = mapper.treeToValue(buildNode(999999), AllFields.class);
    assertThat(parsed.hasEnum()).isFalse();
  }

  @Test(expected = JsonMappingException.class)
  public void testIntDisabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(false);

    mapper.treeToValue(buildNode(999999), AllFields.class);
  }

  private static JsonNode buildNode(String value) {
// Path: src/test/java/com/hubspot/jackson/datatype/protobuf/util/ObjectMapperHelper.java
// public static ObjectMapper camelCase() {
//   return DEFAULT;
// }


// Path: src/test/java/com/hubspot/jackson/datatype/protobuf/ReadUnknownEnumValuesAsNullTest.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hubspot.jackson.datatype.protobuf.util.TestProtobuf.AllFields;
import org.junit.Test;
import static com.hubspot.jackson.datatype.protobuf.util.ObjectMapperHelper.camelCase;
import static org.assertj.core.api.Assertions.assertThat;

package com.hubspot.jackson.datatype.protobuf;



public class ReadUnknownEnumValuesAsNullTest {

  @Test
  public void testStringEnabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(true);

    AllFields parsed = mapper.treeToValue(buildNode("fakeValue"), AllFields.class);
    assertThat(parsed.hasEnum()).isFalse();
  }

  @Test(expected = JsonMappingException.class)
  public void testStringDisabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(false);

    mapper.treeToValue(buildNode("fakeValue"), AllFields.class);
  }

  @Test
  public void testIntEnabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(true);

    AllFields parsed = mapper.treeToValue(buildNode(999999), AllFields.class);
    assertThat(parsed.hasEnum()).isFalse();
  }

  @Test(expected = JsonMappingException.class)
  public void testIntDisabled() throws JsonProcessingException {
    ObjectMapper mapper = objectMapper(false);

    mapper.treeToValue(buildNode(999999), AllFields.class);
  }

  private static JsonNode buildNode(String value) {
    return camelCase().createObjectNode().put("enum", value);