Search in sources :

Example 6 with ParameterResource

use of com.epam.ta.reportportal.ws.model.ParameterResource in project service-api by reportportal.

the class ParametersConverterTest method toResource.

@Test
void toResource() {
    final Parameter parameter = getParameter();
    final ParameterResource resource = ParametersConverter.TO_RESOURCE.apply(parameter);
    assertEquals(resource.getKey(), parameter.getKey());
    assertEquals(resource.getValue(), parameter.getValue());
}
Also used : ParameterResource(com.epam.ta.reportportal.ws.model.ParameterResource) Parameter(com.epam.ta.reportportal.entity.item.Parameter) Test(org.junit.jupiter.api.Test)

Example 7 with ParameterResource

use of com.epam.ta.reportportal.ws.model.ParameterResource in project service-api by reportportal.

the class ParametersConverterTest method toModel.

@Test
void toModel() {
    final ParameterResource resource = getResource();
    final Parameter parameter = ParametersConverter.TO_MODEL.apply(resource);
    assertEquals(parameter.getKey(), resource.getKey());
    assertEquals(parameter.getValue(), resource.getValue());
}
Also used : ParameterResource(com.epam.ta.reportportal.ws.model.ParameterResource) Parameter(com.epam.ta.reportportal.entity.item.Parameter) Test(org.junit.jupiter.api.Test)

Example 8 with ParameterResource

use of com.epam.ta.reportportal.ws.model.ParameterResource in project agent-java-testNG by reportportal.

the class ParametersBypassTest method verify_null_parameter.

private static void verify_null_parameter(List<StartTestItemRQ> methodStarts) {
    assertThat(methodStarts, hasSize(3));
    String strClassName = String.class.getCanonicalName();
    List<String> expectedKeys = Collections.nCopies(3, strClassName);
    List<String> expectedValues = Arrays.asList("one", "two", "NULL");
    List<String> expectedResult = IntStream.range(0, 3).mapToObj(i -> expectedKeys.get(i) + "-" + expectedValues.get(i)).collect(Collectors.toList());
    IntStream.range(0, 3).forEach(i -> {
        List<ParameterResource> params = methodStarts.get(i).getParameters();
        assertThat(params, hasSize(1));
        ParameterResource param = params.get(0);
        assertThat(expectedResult, hasItem(param.getKey() + "-" + param.getValue()));
    });
}
Also used : IntStream(java.util.stream.IntStream) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) ListenerParameters(com.epam.reportportal.listeners.ListenerParameters) Launch(com.epam.reportportal.service.Launch) Mock(org.mockito.Mock) ReportPortal(com.epam.reportportal.service.ReportPortal) ParameterResource(com.epam.ta.reportportal.ws.model.ParameterResource) TestUtils(com.epam.reportportal.testng.integration.util.TestUtils) Mockito.timeout(org.mockito.Mockito.timeout) StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) TestInstance(org.junit.jupiter.api.TestInstance) ArgumentCaptor(org.mockito.ArgumentCaptor) Calendar(java.util.Calendar) com.epam.reportportal.testng.integration.feature.parameters(com.epam.reportportal.testng.integration.feature.parameters) PropertiesLoader(com.epam.reportportal.utils.properties.PropertiesLoader) TestUtils.standardParameters(com.epam.reportportal.testng.integration.util.TestUtils.standardParameters) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ReportPortalClient(com.epam.reportportal.service.ReportPortalClient) ArgumentMatchers.startsWith(org.mockito.ArgumentMatchers.startsWith) MemoizingSupplier(com.epam.reportportal.utils.MemoizingSupplier) Matchers(org.hamcrest.Matchers) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) List(java.util.List) StartLaunchRQ(com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ) TestUtils.namedUuid(com.epam.reportportal.testng.integration.util.TestUtils.namedUuid) Collections(java.util.Collections) ParameterResource(com.epam.ta.reportportal.ws.model.ParameterResource)

Aggregations

ParameterResource (com.epam.ta.reportportal.ws.model.ParameterResource)8 Test (org.junit.jupiter.api.Test)6 Parameter (com.epam.ta.reportportal.entity.item.Parameter)4 TestItem (com.epam.ta.reportportal.entity.item.TestItem)3 StartTestItemRQ (com.epam.ta.reportportal.ws.model.StartTestItemRQ)3 ListenerParameters (com.epam.reportportal.listeners.ListenerParameters)1 Launch (com.epam.reportportal.service.Launch)1 ReportPortal (com.epam.reportportal.service.ReportPortal)1 ReportPortalClient (com.epam.reportportal.service.ReportPortalClient)1 com.epam.reportportal.testng.integration.feature.parameters (com.epam.reportportal.testng.integration.feature.parameters)1 TestUtils (com.epam.reportportal.testng.integration.util.TestUtils)1 TestUtils.namedUuid (com.epam.reportportal.testng.integration.util.TestUtils.namedUuid)1 TestUtils.standardParameters (com.epam.reportportal.testng.integration.util.TestUtils.standardParameters)1 MemoizingSupplier (com.epam.reportportal.utils.MemoizingSupplier)1 PropertiesLoader (com.epam.reportportal.utils.properties.PropertiesLoader)1 ItemAttribute (com.epam.ta.reportportal.entity.ItemAttribute)1 Launch (com.epam.ta.reportportal.entity.launch.Launch)1 ItemAttributesRQ (com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ)1 StartLaunchRQ (com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ)1 LocalDateTime (java.time.LocalDateTime)1