<commit_before>package one.kii.kiimate.status.cases.spi;

import one.kii.summer.io.exception.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by WangYanJiong on 4/7/17.
 */

@RunWith(SpringJUnit4ClassRunner.class)
@BootstrapWith(SpringBootTestContextBootstrapper.class)
@ComponentScan("com.sinewang")
@SpringBootTest(classes = {TestRefreshStateSpi.class})
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class TestRefreshStateSpi {


    @Autowired
    private RefreshStatusSpi refreshStatusSpi;

    @Test
    public void testGntForm() {
        RefreshStatusSpi.GroupNameTreeForm form = new RefreshStatusSpi.GroupNameTreeForm();
        form.setOwnerId("wangyj");
        form.setGroup("test-token");
        form.setName("default");
        form.setTree("master");
        form.setObject(new Token1());
        try {
            refreshStatusSpi.commit(form);
        } catch (Panic | Forbidden | BadRequest | NotFound | Conflict oops) {
            oops.printStackTrace();
        }
    }

    @Test
    public void testSubIdForm() {
        RefreshStatusSpi.SubIdForm form = new RefreshStatusSpi.SubIdForm();
        form.setSubId("48982345f8c901d266ced0cfb6cd471654b2105fd18bbd512d5b266358dcbace");
        form.setOwnerId("wangyj");
        form.setObject(new Token2());
        try {
            refreshStatusSpi.commit(form);
        } catch (Panic | Forbidden | BadRequest | NotFound | Conflict oops) {
            oops.printStackTrace();
        }
    }

    public static class Token1 {
        int expiresIn = 10;

        public int getExpiresIn() {
            return expiresIn;
        }

        public void setExpiresIn(int expiresIn) {
            this.expiresIn = expiresIn;
        }
    }

    public static class Token2 {
        int expiresIn = 11;

        public int getExpiresIn() {
            return expiresIn;
        }

        public void setExpiresIn(int expiresIn) {
            this.expiresIn = expiresIn;
        }
    }

}
<commit_msg>improve test case<commit_after>package one.kii.kiimate.status.cases.spi;

import one.kii.summer.io.exception.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by WangYanJiong on 4/7/17.
 */

@RunWith(SpringJUnit4ClassRunner.class)
@BootstrapWith(SpringBootTestContextBootstrapper.class)
@ComponentScan("com.sinewang")
@SpringBootTest(classes = {TestRefreshStateSpi.class})
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class TestRefreshStateSpi {


    @Autowired
    private RefreshStatusSpi refreshStatusSpi;

    @Test
    public void testGntForm() {
        RefreshStatusSpi.GroupNameTreeForm<Token1> form = new RefreshStatusSpi.GroupNameTreeForm<>();
        form.setOwnerId("wangyj");
        form.setGroup("test-token");
        form.setName("default");
        form.setTree("master");
        form.setObject(new Token1());
        try {
            refreshStatusSpi.commit(form);
        } catch (Panic | Forbidden | BadRequest | NotFound | Conflict oops) {
            oops.printStackTrace();
        }
    }

    @Test
    public void testSubIdForm() {
        RefreshStatusSpi.SubIdForm<Token2> form = new RefreshStatusSpi.SubIdForm<>();
        form.setSubId("48982345f8c901d266ced0cfb6cd471654b2105fd18bbd512d5b266358dcbace");
        form.setOwnerId("wangyj");
        form.setObject(new Token2());
        try {
            refreshStatusSpi.commit(form);
        } catch (Panic | Forbidden | BadRequest | NotFound | Conflict oops) {
            oops.printStackTrace();
        }
    }

    public static class Token1 {
        int expiresIn = 10;

        public int getExpiresIn() {
            return expiresIn;
        }

        public void setExpiresIn(int expiresIn) {
            this.expiresIn = expiresIn;
        }
    }

    public static class Token2 {
        int expiresIn = 11;

        public int getExpiresIn() {
            return expiresIn;
        }

        public void setExpiresIn(int expiresIn) {
            this.expiresIn = expiresIn;
        }
    }

}

{'fraction_non_alphanumeric': 0.09415470773538677, 'fraction_numerical': 0.019250962548127408, 'mean_word_length': 3.4683346364347147, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6545677', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1622, 'n_words': 264}