Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Feb 8, 2024
1 parent 7e38164 commit f37aaea
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/java/com/epam/reportportal/cucumber/EmbeddingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,28 @@ public class EmbeddingTest {
@CucumberOptions(features = "src/test/resources/features/embedding/ImageEmbeddingFeature.feature", glue = {
"com.epam.reportportal.cucumber.integration.embed.image" }, plugin = { "pretty",
"com.epam.reportportal.cucumber.integration.TestStepReporter" })
public static class ImageStepReporter extends AbstractTestNGCucumberTests {
public static class ImageStepReporterTest extends AbstractTestNGCucumberTests {

}

@CucumberOptions(features = "src/test/resources/features/embedding/TextEmbeddingFeature.feature", glue = {
"com.epam.reportportal.cucumber.integration.embed.text" }, plugin = { "pretty",
"com.epam.reportportal.cucumber.integration.TestStepReporter" })
public static class TextStepReporter extends AbstractTestNGCucumberTests {
public static class TextStepReporterTest extends AbstractTestNGCucumberTests {

}

@CucumberOptions(features = "src/test/resources/features/embedding/PdfEmbeddingFeature.feature", glue = {
"com.epam.reportportal.cucumber.integration.embed.pdf" }, plugin = { "pretty",
"com.epam.reportportal.cucumber.integration.TestStepReporter" })
public static class PdfStepReporter extends AbstractTestNGCucumberTests {
public static class PdfStepReporterTest extends AbstractTestNGCucumberTests {

}

@CucumberOptions(features = "src/test/resources/features/embedding/ArchiveEmbeddingFeature.feature", glue = {
"com.epam.reportportal.cucumber.integration.embed.zip" }, plugin = { "pretty",
"com.epam.reportportal.cucumber.integration.TestStepReporter" })
public static class ZipStepReporter extends AbstractTestNGCucumberTests {
public static class ZipStepReporterTest extends AbstractTestNGCucumberTests {

}

Expand Down Expand Up @@ -118,7 +118,7 @@ public void setup() {

@Test
public void verify_image_embedding() {
TestUtils.runTests(ImageStepReporter.class);
TestUtils.runTests(ImageStepReporterTest.class);

ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(client, atLeastOnce()).log(logCaptor.capture());
Expand All @@ -132,7 +132,7 @@ public void verify_image_embedding() {

@Test
public void verify_text_embedding() {
TestUtils.runTests(TextStepReporter.class);
TestUtils.runTests(TextStepReporterTest.class);

ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(client, atLeastOnce()).log(logCaptor.capture());
Expand All @@ -145,8 +145,8 @@ public void verify_text_embedding() {
}

@Test
public void verify_pfd_embedding() {
TestUtils.runTests(PdfStepReporter.class);
public void verify_pdf_embedding() {
TestUtils.runTests(PdfStepReporterTest.class);

ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(client, atLeastOnce()).log(logCaptor.capture());
Expand All @@ -155,19 +155,19 @@ public void verify_pfd_embedding() {
List<String> types = getTypes(logCaptor, logs);

assertThat(types, hasSize(3));
assertThat(types, containsInAnyOrder("application/pdf", "image/png", "application/octet-stream"));
assertThat(types, containsInAnyOrder("application/pdf", "image/png", "application/pdf"));
}

@Test
public void verify_archive_embedding() {
TestUtils.runTests(ZipStepReporter.class);
TestUtils.runTests(ZipStepReporterTest.class);

ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(client, atLeastOnce()).log(logCaptor.capture());
List<SaveLogRQ> logs = filterLogs(logCaptor, l -> Objects.nonNull(l.getFile()));

List<String> types = getTypes(logCaptor, logs);
assertThat(types, hasSize(3));
assertThat(types, containsInAnyOrder("application/zip", "image/png", "application/octet-stream"));
assertThat(types, containsInAnyOrder("application/zip", "image/png", "application/zip"));
}
}

0 comments on commit f37aaea

Please sign in to comment.