@Test
public void testSetType() throws InvalidMapBoxStyleException {

    // Test invalid type
    try {
        SortFieldConfig config = new SortFieldConfig();
        config.setType("invalid_type");
        Assert.fail("InvalidMapBoxStyleException didn't get thrown for an invalid type");
    } catch (InvalidMapBoxStyleException e) {
    }
    try {
        SortFieldConfig config = new SortFieldConfig();
        config.setType("");
        Assert.fail("InvalidMapBoxStyleException didn't get thrown for an invalid type");
    } catch (InvalidMapBoxStyleException e) {
    }
    try {
        SortFieldConfig config = new SortFieldConfig();
        config.setType((String) null);
        Assert.fail("InvalidMapBoxStyleException didn't get thrown for an invalid type");
    } catch (InvalidMapBoxStyleException e) {
    }
    SortFieldConfig config1 = new SortFieldConfig();
    config1.setType(SortFieldConfig.FieldType.DATE);
    Assert.assertEquals(SortFieldConfig.FieldType.DATE, config1.getType());
    SortFieldConfig config2 = new SortFieldConfig();
    config2.setType(SortFieldConfig.FieldType.NUMBER);
    Assert.assertEquals(SortFieldConfig.FieldType.NUMBER, config2.getType());
    SortFieldConfig config3 = new SortFieldConfig();
    config3.setType(SortFieldConfig.FieldType.STRING);
    Assert.assertEquals(SortFieldConfig.FieldType.STRING, config3.getType());
}