package cz.moneta.test.system.ilodsserver;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.annotations.TestScenario;
import itSodTesting.sharedResources.objects.ilods.enumerations.IlApplTp;
import itSodTesting.sharedResources.objects.ilods.enumerations.IlBusProdClass;
import itSodTesting.sharedResources.objects.ilods.enumerations.IlSubType;
import itSodTesting.sharedResources.objects.ilods.enumerations.IlType;
import org.junit.jupiter.api.Assertions;

@TestScenario(name = "Check Ilods Server functions")
public class IlodsServerTest {

    @TestCase(name = "Test Ilods Server availability")
    public void callTestAction(Harness harness) {
        String response = harness.withIlods().sendTestRequest();
        Assertions.assertEquals("OK", response);
    }

    @TestCase(name = "Test set score function")
    public void testSetScore(Harness harness) {
        harness.withIlods().setScore("AFX01", "451224666", null);
    }

    @TestCase(name = "Test set turnovers function")
    public void testSetTurnovers(Harness harness) {
        String result = harness.withIlods().setTurnovers("207782484", "3000046363", 50000);
        Assertions.assertEquals("0", result);
    }

    @TestCase(name = "Test set infolimit function")
    public void testSetInfolimit(Harness harness) {
        String result = harness.withIlods().setInfolimit(IlBusProdClass.KK, IlType.NEZAVAZNY_A, IlSubType.XIL_ON_PROD, 50000, IlApplTp.Sc, "451224666", null);
        Assertions.assertEquals("0", result);
    }

    @TestCase(name = "Test set segment function")
    public void testSetSegment(Harness harness) {
        String result = harness.withIlods().setSegment("AS_FAM", "EXIST", "451224666", null);
        Assertions.assertEquals("0", result);
    }
}