Skip to content

Commit

Permalink
test: remove tests for SeriesSalesImportServiceImpl class
Browse files Browse the repository at this point in the history
Part of #1668
  • Loading branch information
php-coder committed Mar 14, 2024
1 parent da0d240 commit 68030d2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class SeriesSalesImportServiceImpl implements SeriesSalesImportService {
private final SiteParserService siteParserService;
private final SeriesInfoExtractorService extractorService;

// @todo #995 SeriesSalesImportServiceImpl.downloadAndParse(): add unit tests
@Override
@Transactional(readOnly = true)
@PreAuthorize(HasAuthority.IMPORT_SERIES)
Expand Down

This file was deleted.

52 changes: 0 additions & 52 deletions src/test/java/ru/mystamps/web/service/TestObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@
import ru.mystamps.web.feature.account.UsersActivationFullDto;
import ru.mystamps.web.feature.image.ImageDto;
import ru.mystamps.web.feature.image.ImageInfoDto;
import ru.mystamps.web.feature.series.importing.sale.SeriesSaleParsedDataDto;
import ru.mystamps.web.feature.series.importing.sale.SeriesSalesParsedDataDbDto;
import ru.mystamps.web.feature.site.SuspiciousActivityDto;
import ru.mystamps.web.tests.Random;

import java.nio.charset.StandardCharsets;
import java.util.Date;

import static io.qala.datagen.RandomShortApi.bool;
import static io.qala.datagen.RandomShortApi.nullOr;

public final class TestObjects {
public static final String TEST_ACTIVITY_TYPE = "EventType";
public static final String TEST_ACTIVITY_PAGE = "http://example.org/some/page";
Expand Down Expand Up @@ -121,51 +116,4 @@ public static SuspiciousActivityDto createSuspiciousActivityDto() {
);
}

public static SeriesSalesParsedDataDbDto createSeriesSalesParsedDataDbDto() {
SeriesSalesParsedDataDbDto dto = new SeriesSalesParsedDataDbDto();

boolean existingSeller = bool();
if (existingSeller) {
dto.setSellerId(Random.id());
} else {
dto.setSellerName(Random.sellerName());
dto.setSellerUrl(Random.url());
}

dto.setPrice(Random.price());
dto.setCurrency(Random.currency().toString());
dto.setCreatedAt(Random.date());
dto.setUpdatedAt(Random.date());
return dto;
}

public static SeriesSaleParsedDataDto createSeriesSaleParsedDataDto() {
Integer sellerId = null;
Integer sellerGroupId = null;
String sellerName = null;
String sellerUrl = null;

boolean existingSeller = bool();
if (existingSeller) {
sellerId = Random.id();
} else {
sellerGroupId = Random.id();
sellerName = Random.sellerName();
sellerUrl = Random.url();
}

return new SeriesSaleParsedDataDto(
sellerId,
sellerGroupId,
sellerName,
sellerUrl,
Random.price(),
Random.currency(),
Random.price(),
// FIXME: alternative currency shouldn't match with currency
Random.currency(),
nullOr(Random.seriesCondition())
);
}

}
5 changes: 0 additions & 5 deletions src/test/java/ru/mystamps/web/tests/Random.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import ru.mystamps.web.feature.country.CountryValidation;
import ru.mystamps.web.feature.participant.ParticipantValidation;
import ru.mystamps.web.feature.series.SeriesValidation;
import ru.mystamps.web.feature.series.sale.SeriesCondition;
import ru.mystamps.web.feature.site.SiteUrl;

import java.math.BigDecimal;
Expand Down Expand Up @@ -101,10 +100,6 @@ public static Currency currency() {
return sample(Currency.values());
}

public static SeriesCondition seriesCondition() {
return sample(SeriesCondition.values());
}

public static String url() {
final long minLength = 5;
final long maxLength = 15;
Expand Down

0 comments on commit 68030d2

Please sign in to comment.