// 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.RepeatedFields;
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 AcceptSingleValueAsArrayTest {

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

    RepeatedFields parsed = mapper.treeToValue(buildNode(), RepeatedFields.class);
    assertThat(parsed.getBoolCount()).isEqualTo(1);
    assertThat(parsed.getBoolList()).containsExactly(true);
  }

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

    mapper.treeToValue(buildNode(), RepeatedFields.class);
  }

  private static JsonNode buildNode() {
// 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/AcceptSingleValueAsArrayTest.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.RepeatedFields;
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 AcceptSingleValueAsArrayTest {

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

    RepeatedFields parsed = mapper.treeToValue(buildNode(), RepeatedFields.class);
    assertThat(parsed.getBoolCount()).isEqualTo(1);
    assertThat(parsed.getBoolList()).containsExactly(true);
  }

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

    mapper.treeToValue(buildNode(), RepeatedFields.class);
  }

  private static JsonNode buildNode() {
    return camelCase().createObjectNode().put("bool", true);