Вы здесь:

Пример проекта с gradle и kotlin: https://github.com/cherepakhin/shop_kotlin
В проекте описано все, что нужно для сборки и deploy.

Примечания:


Смена версии gradle для проекта:

./gradlew wrapper --gradle-version 7.4.2

https://tomgregory.com/gradle/how-to-update-gradle/ Запуск конкретного теста из консоли:

./gradlew test --tests "material.design.controller.CountryControllerMvcTest"

Тест для сервиса с авторизацией (ключевое @WithMockUser(value = "user")):

@RunWith(SpringRunner.class)
@WebMvcTest(CountryController.class)
public class CountryControllerMvcTest {
    @Autowired
    private MockMvc mockMvc;
    @MockBean
    CountryRepository repository;

    @WithMockUser(value = "user")
    @Test
    public void getCountryOk() throws Exception {
        List countries = new ArrayList<>();
        Country country = new Country();
        country.setId(1L);
        countries.add(country);
        when(repository.findAll()).thenReturn(countries);
        this.mockMvc.perform(get("/country")).andDo(print()).andExpect(status().isOk());
    }
    ...

Прогон только интеграционных тестов:

./gradlew test -Dtest.profile=integration

Для этого в build.gradle прописать:

test {
    if (System.properties['test.profile'] != 'integration') {
    exclude '**/*integrationTests*'
}