<commit_before>package com.beta.api.v1;

import com.beta.Main;
import com.beta.RopeGrade;
import com.beta.Route;
import com.google.common.io.Resources;
import io.dropwizard.testing.junit.DropwizardAppRule;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;

import java.util.List;

public class RoutesAcceptanceTest {
    @ClassRule
    public static final DropwizardAppRule<Main.BetaConfig> RULE =
            new DropwizardAppRule<>(Main.class, Resources.getResource("beta.yml").getPath());

    private static RoutesClient c;

    @BeforeClass
    public static void setup() {
        c = new RoutesClient(String.format("http://localhost:%d", RULE.getLocalPort()));
    }

    @Test
    public void getAll() {
        List<Route> all = c.getAll();
        for(Route r : all) {
            System.out.println(r);
        }
        System.out.println(c.add(new Route.BaseInfo("foo", RopeGrade._5_0)));
    }
}<commit_msg>Adds basic test for new route creation<commit_after>package com.beta.api.v1;

import com.beta.Grade;
import com.beta.Main;
import com.beta.RopeGrade;
import com.beta.Route;
import com.google.common.io.Resources;
import io.dropwizard.testing.junit.DropwizardAppRule;
import org.fest.assertions.api.Assertions;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;

import java.util.List;

public class RoutesAcceptanceTest {
    @ClassRule
    public static final DropwizardAppRule<Main.BetaConfig> RULE =
            new DropwizardAppRule<>(Main.class, Resources.getResource("beta.yml").getPath());

    private static RoutesClient c;

    @BeforeClass
    public static void setup() {
        c = new RoutesClient(String.format("http://localhost:%d", RULE.getLocalPort()));
    }

    @Test
    public void newUserIncrementsUserCount() {
        int beforeCount = c.getAll().size();
        c.add(new Route.BaseInfo("Foo Route", RopeGrade._5_10a));
        Assertions.assertThat(beforeCount + 1).isEqualTo(c.getAll().size());
    }

    @Test
    public void newUserInfoMatches() {
        String name = "<NAME>";
        Grade grade = RopeGrade._5_10a;
        Route added = c.add(new Route.BaseInfo(name, grade));
        Assertions.assertThat(name).isEqualTo(added.info.name);
        Assertions.assertThat(grade).isEqualTo(added.info.grade);
    }
}
{'fraction_non_alphanumeric': 0.12601800257179596, 'fraction_numerical': 0.004714959279897128, 'mean_word_length': 3.514506769825919, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '527612', 'n_tokens_mistral': 752, 'n_tokens_neox': 734, 'n_words': 144}