File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
client/src/test/java/eu/europeana/processing Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 8
8
import eu .europeana .processing .config .db .entity .ExecutionRecordExceptionLog ;
9
9
import eu .europeana .processing .config .db .repositories .ExecutionRecordExceptionLogRepository ;
10
10
import eu .europeana .processing .config .db .repositories .ExecutionRecordRepository ;
11
+ import eu .europeana .processing .config .db .repositories .TaskInfoRepository ;
11
12
import jakarta .annotation .Resource ;
12
13
import java .io .IOException ;
13
14
import java .lang .invoke .MethodHandles ;
@@ -40,6 +41,9 @@ public abstract class AbstractPerformanceIT {
40
41
@ Resource
41
42
protected ExecutionRecordExceptionLogRepository <ExecutionRecordExceptionLog > executionRecordExceptionLogRepository ;
42
43
44
+ @ Resource
45
+ protected TaskInfoRepository taskInfoRepository ;
46
+
43
47
private static boolean firstTest = true ;
44
48
45
49
private static boolean cleared ;
@@ -87,6 +91,7 @@ protected void validateResult(int stepNumber) throws IOException {
87
91
long expectedErrorCount = stepNumber != 2 ? 0 : sourceProperties .getRecordCount () - sourceProperties .getValidRecordCount ();
88
92
Assertions .assertThat (executionRecordRepository .countByDatasetIdAndExecutionId (datasetId , taskId )).isEqualTo (expectedRecordCount );
89
93
Assertions .assertThat (executionRecordExceptionLogRepository .countByDatasetIdAndExecutionId (datasetId , taskId )).isEqualTo (expectedErrorCount );
94
+ Assertions .assertThat (taskInfoRepository .getByTaskId (Long .parseLong (taskId )).getWriteCount ()).isEqualTo (expectedRecordCount + expectedErrorCount );
90
95
}
91
96
92
97
}
Original file line number Diff line number Diff line change
1
+ package eu .europeana .processing .config .db .entity ;
2
+
3
+ import jakarta .persistence .Column ;
4
+ import jakarta .persistence .Entity ;
5
+ import jakarta .persistence .Id ;
6
+ import jakarta .persistence .Table ;
7
+ import lombok .Getter ;
8
+ import lombok .Setter ;
9
+
10
+ @ Entity
11
+ @ Getter
12
+ @ Setter
13
+ @ Table (schema = "batch-framework" )
14
+ public class TaskInfo {
15
+
16
+ @ Id
17
+ @ Column (nullable = false , length = 50 )
18
+ private Long taskId ;
19
+
20
+ @ Column
21
+ private Long commitCount ;
22
+
23
+ @ Column
24
+ private Long writeCount ;
25
+ }
Original file line number Diff line number Diff line change
1
+ package eu .europeana .processing .config .db .repositories ;
2
+
3
+ import eu .europeana .processing .config .db .entity .TaskInfo ;
4
+ import org .springframework .data .jpa .repository .JpaRepository ;
5
+ import org .springframework .stereotype .Repository ;
6
+
7
+ @ Repository
8
+ public interface TaskInfoRepository extends JpaRepository <TaskInfo , Long > {
9
+ TaskInfo getByTaskId (Long taskId );
10
+ }
You can’t perform that action at this time.
0 commit comments