<commit_before>package ru.ifmo.p3411;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.client.MockRestServiceServer;
import ru.ifmo.p3411.data.KanbanUser;
import ru.ifmo.p3411.data.Task;
import ru.ifmo.p3411.repositories.BoardColumnRepository;
import ru.ifmo.p3411.repositories.BoardRepository;
import ru.ifmo.p3411.repositories.KanbanUserRepository;
import ru.ifmo.p3411.repositories.TaskRepository;


/**
 * @author vtaravkov
 * @since 1.0
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class SmokeTest {
    @Autowired
    private KanbanUserRepository userRepository;

    @Autowired
    private TestRestTemplate restTemplate;

    @Test
    public void puff() {
        KanbanUser expected = new KanbanUser("uname", "fname", null, "lname");
        expected = userRepository.save(expected);
        KanbanUser actual = restTemplate.getForObject("/kanbanUsers/" + expected.getId(), KanbanUser.class);
        Assert.assertEquals("REST works OK", expected, actual);
    }
}<commit_msg>KANBAN-41 Map REST services to data repositories<commit_after>package ru.ifmo.p3411;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.web.client.RestClientTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.client.MockRestServiceServer;
import ru.ifmo.p3411.data.KanbanUser;
import ru.ifmo.p3411.data.Task;
import ru.ifmo.p3411.repositories.BoardColumnRepository;
import ru.ifmo.p3411.repositories.BoardRepository;
import ru.ifmo.p3411.repositories.KanbanUserRepository;
import ru.ifmo.p3411.repositories.TaskRepository;


/**
 * @author vtaravkov
 * @since 1.0
 */
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class SmokeTest {
    @Autowired
    private KanbanUserRepository userRepository;

    @Autowired
    private TestRestTemplate restTemplate;

    @Test
    public void puff() {
        KanbanUser expected = new KanbanUser("uname", "fname", null, "lname");
        expected = userRepository.save(expected);
        KanbanUser actual = restTemplate.getForObject("/kanbanUsers/" + expected.getId(), KanbanUser.class);
        Assert.assertEquals("REST GET works OK", expected, actual);

        expected.setUsername("changed");
        restTemplate.put("/kanbanUsers/" + expected.getId(), expected);
        actual = userRepository.findOne(expected.getId());
        Assert.assertEquals("REST PUT works OK", expected, actual);
    }
}
{'fraction_non_alphanumeric': 0.10213345438039037, 'fraction_numerical': 0.015433499773036768, 'mean_word_length': 5.821981424148607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1463021', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1242, 'n_words': 201}