Skip to content

Commit

Permalink
GRAD2-2822: School Report Regeneration Process - Backend Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-mohammed committed Sep 9, 2024
1 parent 8c99500 commit 8948a7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Map<String, ExecutionContext> partition(int gridSize) {
executionContext.put("readCount", 0);
map.put("partition0", executionContext);

log.info("Found {} in total running on 1 partitions", finalSchoolDistricts);
log.info("Found {} in total running on 1 partitions", finalSchoolDistricts.size());
return map;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public List<String> read() throws Exception {
if(readCount > 0) return null;
readCount++;
if(log.isDebugEnabled()) {
log.info("Read schools Codes -> {} of {} schools", schools.size(), String.join(",", schools));
log.info("Read schools Codes -> {} of {} schools", readCount, schools.size());
}
return schools;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,24 @@ public void testcreateAndStoreSchoolReports_0() {
assertNotNull(type);
assertNotNull(result);
}
@Test
public void testcreateAndStoreSchoolReports_WithParams() {
final String type = "TVRRUN";

when(this.webClient.post()).thenReturn(this.requestBodyUriMock);
when(this.requestBodyUriMock.uri(String.format(constants.getCreateAndStoreSchoolReports(),type))).thenReturn(this.requestBodyUriMock);
when(this.requestBodyUriMock.headers(any(Consumer.class))).thenReturn(this.requestBodyMock);
when(this.requestBodyMock.contentType(any())).thenReturn(this.requestBodyMock);
when(this.requestBodyMock.body(any(BodyInserter.class))).thenReturn(this.requestHeadersMock);
when(this.requestHeadersMock.retrieve()).thenReturn(this.responseMock);
when(this.responseMock.bodyToMono(Integer.class)).thenReturn(Mono.just(0));

mockTokenResponseObject();

var result = this.restUtils.createAndStoreSchoolReports(Arrays.asList("12345"), type, new DistributionSummaryDTO());
assertNotNull(type);
assertNotNull(result);
}

@Test
public void testRunGradAlgorithm() {
Expand Down

0 comments on commit 8948a7b

Please sign in to comment.