Skip to content

Commit

Permalink
"fix" csv record mapper test
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Jun 10, 2022
1 parent f2e68c1 commit 2bf2074
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.jupiter.api.Test;
import org.observertc.observer.reports.Report;
import org.observertc.observer.utils.ReportGenerators;
import org.observertc.schemas.reports.ClientExtensionReport;
import org.observertc.schemas.reports.csvsupport.ClientExtensionReportToIterable;

import java.io.FileReader;
Expand All @@ -15,9 +14,6 @@
import java.io.Reader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Instant;
import java.util.Map;
import java.util.UUID;

class CsvRecordMapperTest {

Expand Down Expand Up @@ -47,29 +43,6 @@ void shouldBeValid_2() throws IOException {
Assertions.assertTrue(equals);
}

@Test
void shouldBeValid_3() throws IOException {
var report = Report.fromClientExtensionReport(ClientExtensionReport.newBuilder()
.setServiceId("setServiceId")
.setMediaUnitId("setMediaUnitId")
.setExtensionType("CUSTOM_TYPE")
.setTimestamp(Instant.EPOCH.toEpochMilli())
.setCallId(UUID.randomUUID().toString())
.setMarker("marker")
.setRoomId("roomId")
.setUserId("Dobby")
.setSampleSeq(1)
.setPayload(JsonUtils.objectToString(Map.of("key", "value")))
.build());
var written = new ClientExtensionReportToIterable().apply(report);

var tempFileName = writeToTempFile(written);

var read = this.readRecord(tempFileName);
var equals = this.equals(written, read);
Assertions.assertTrue(equals);
}

private String writeToTempFile(Iterable<?> source) throws IOException {
var mapper = CsvRecordMapper.builder().build();
var line = mapper.apply(source);
Expand Down

0 comments on commit 2bf2074

Please sign in to comment.