Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.unitils.reflectionassert.ReflectionAssert;
import org.unitils.reflectionassert.ReflectionComparatorMode;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -49,14 +48,14 @@ public class AspectsSDKCoreTest {
public void testAspectsDelta() {
BulkAspectResponse previousFileData = dataProvider.getBulkAspectMockedData(true);
BulkAspectResponse currentFileData = dataProvider.getBulkAspectMockedData();
AspectsDelta actualDelta = aspectDeltaProcessor.process(getIndexedData(previousFileData),getIndexedData(currentFileData));
AspectsDelta actualDelta = aspectDeltaProcessor.process(getIndexedData(previousFileData), getIndexedData(currentFileData));
AspectsDelta expectedDelta = dataProvider.getExpectedResult();
ReflectionAssert.assertReflectionEquals(expectedDelta,actualDelta, ReflectionComparatorMode.IGNORE_DEFAULTS);
ReflectionAssert.assertLenientEquals(expectedDelta, actualDelta);

}

private Map<String, List<Aspect>> getIndexedData(BulkAspectResponse bulkAspectResponse) {
return bulkAspectResponse.getCategoryAspects().stream().
collect(Collectors.toMap(c -> c.getCategory().getCategoryId(), c -> c.getAspects() != null ? c.getAspects() : new ArrayList<Aspect>()));
collect(Collectors.toMap(c -> c.getCategory().getCategoryId(), c -> c.getAspects() != null ? c.getAspects() : new ArrayList<>()));
}
}