<commit_before>package net.nemerosa.ontrack.boot.ui

import net.nemerosa.ontrack.model.security.SecurityService
import net.nemerosa.ontrack.model.settings.PredefinedValidationStampService
import net.nemerosa.ontrack.model.structure.*
import net.nemerosa.ontrack.ui.controller.AbstractResourceController
import net.nemerosa.ontrack.ui.controller.MockURIBuilder
import net.nemerosa.ontrack.ui.resource.PaginationCountException
import net.nemerosa.ontrack.ui.resource.PaginationOffsetException
import net.nemerosa.ontrack.ui.resource.Resources
import org.junit.Before
import org.junit.Test

import java.lang.reflect.Field

import static net.nemerosa.ontrack.model.structure.NameDescription.nd
import static org.mockito.Mockito.mock
import static org.mockito.Mockito.when

class ValidationRunControllerTest {

    private ValidationRunController controller
    private StructureService structureService
    private PropertyService propertyService
    private PredefinedValidationStampService predefinedValidationStampService
    private SecurityService securityService
    private final Branch branch = Branch.of(
            Project.of(nd("P", "Project")).withId(ID.of(1)),
            nd("B", "Branch")
    ).withId(ID.of(1))
    private final ValidationStamp validationStamp = ValidationStamp.of(
            branch,
            nd('VS', 'Validation stamp')
    ).withId(ID.of(1))

    @Before
    void before() {
        structureService = mock(StructureService.class)
        ValidationRunStatusService validationRunStatusService = mock(ValidationRunStatusService.class)
        propertyService = mock(PropertyService.class)
        securityService = mock(SecurityService.class)
        predefinedValidationStampService = mock(PredefinedValidationStampService)
        controller = new ValidationRunController(
                structureService,
                validationRunStatusService, validationDataTypeService,
                propertyService,
                securityService
        )<commit_msg>#176 Correction of tests<commit_after>package net.nemerosa.ontrack.boot.ui

import net.nemerosa.ontrack.model.security.SecurityService
import net.nemerosa.ontrack.model.settings.PredefinedValidationStampService
import net.nemerosa.ontrack.model.structure.*
import net.nemerosa.ontrack.ui.controller.AbstractResourceController
import net.nemerosa.ontrack.ui.controller.MockURIBuilder
import net.nemerosa.ontrack.ui.resource.PaginationCountException
import net.nemerosa.ontrack.ui.resource.PaginationOffsetException
import net.nemerosa.ontrack.ui.resource.Resources
import org.junit.Before
import org.junit.Test

import java.lang.reflect.Field

import static net.nemerosa.ontrack.model.structure.NameDescription.nd
import static org.mockito.Mockito.mock
import static org.mockito.Mockito.when

class ValidationRunControllerTest {

    private ValidationRunController controller
    private StructureService structureService
    private PropertyService propertyService
    private PredefinedValidationStampService predefinedValidationStampService
    private SecurityService securityService
    private final Branch branch = Branch.of(
            Project.of(nd("P", "Project")).withId(ID.of(1)),
            nd("B", "Branch")
    ).withId(ID.of(1))
    private final ValidationStamp validationStamp = ValidationStamp.of(
            branch,
            nd('VS', 'Validation stamp')
    ).withId(ID.of(1))

    @Before
    void before() {
        structureService = mock(StructureService.class)
        ValidationRunStatusService validationRunStatusService = mock(ValidationRunStatusService.class)
        ValidationDataTypeService validationDataTypeService = mock(ValidationDataTypeService)
        propertyService = mock(PropertyService.class)
        securityService = mock(SecurityService.class)
        predefinedValidationStampService = mock(PredefinedValidationStampService)
        controller = new ValidationRunController(
                structureService,
                validationRunStatusService,
                validationDataTypeService,
                propertyService,
                securityService
        )
{'fraction_non_alphanumeric': 0.07366125514901865, 'fraction_numerical': 0.002180760843227526, 'mean_word_length': 4.009708737864078, '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': '5541876', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1041, 'n_words': 190}