use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.
the class TrackerPreheatServiceIntegration method testPreheatWithDifferentIdSchemes.
@Test
@Disabled
void testPreheatWithDifferentIdSchemes() {
TrackedEntity teA = TrackedEntity.builder().orgUnit("OUA").trackedEntityType(TET_UID).build();
Enrollment enrollmentA = Enrollment.builder().orgUnit("OUA").program("PROGRAM1").trackedEntity(TE_UID).build();
TrackerImportParams trackerPreheatParams = TrackerImportParams.builder().trackedEntities(Lists.newArrayList(teA)).enrollments(Lists.newArrayList(enrollmentA)).identifiers(TrackerIdentifierParams.builder().idScheme(TrackerIdentifier.UID).orgUnitIdScheme(TrackerIdentifier.CODE).programIdScheme(TrackerIdentifier.builder().idScheme(TrackerIdScheme.ATTRIBUTE).value(ATTRIBUTE_UID).build()).build()).build();
TrackerPreheat preheat = trackerPreheatService.preheat(trackerPreheatParams);
assertNotNull(preheat);
assertNotNull(preheat.getMap());
}
use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.
the class RegistrationSingleEventServiceTest method testDeleteEventShouldReturnReference.
@Test
@Disabled("luciano -> re-enable after delete has been implemented")
void testDeleteEventShouldReturnReference() {
Enrollment enrollment = createEnrollment(programA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance());
ImportSummary importSummary = enrollmentService.addEnrollment(enrollment, null, null);
assertEquals(ImportStatus.SUCCESS, importSummary.getStatus());
Event event = createEvent(programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance());
importSummary = eventService.addEvent(event, null, false);
assertEquals(ImportStatus.SUCCESS, importSummary.getStatus());
TrackedEntityInstance tei = trackedEntityInstanceService.getTrackedEntityInstance(maleA.getUid());
importSummary = eventService.deleteEvent(tei.getEnrollments().get(0).getEvents().get(0).getEvent());
assertEquals(ImportStatus.SUCCESS, importSummary.getStatus());
assertNotNull(importSummary.getReference());
assertEquals(tei.getEnrollments().get(0).getEvents().get(0).getEvent(), importSummary.getReference());
}
use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.
the class AuditRepositoryTest method testAuditInsert200k.
@Test
@Disabled
void testAuditInsert200k() {
List<Audit> audits = new ArrayList<>();
IntStream.rangeClosed(1, 200_000).forEach(n -> {
String uid = CodeGenerator.generateUid();
String code = CodeGenerator.generateUid();
Audit audit = Audit.builder().auditType(AuditType.CREATE).auditScope(AuditScope.AGGREGATE).createdAt(LocalDateTime.of(2000, 1, 1, 0, 0)).createdBy("test-user").klass(DataElement.class.getName()).uid(uid).code(code).data("{}").build();
audits.add(audit);
});
Timer timer = new Timer().start();
audits.forEach(audit -> auditRepository.save(audit));
System.err.println("Single Insert: " + timer.getTimeInS() + "s");
assertEquals(200_000, auditRepository.count(AuditQuery.builder().build()));
}
use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.
the class ObjectBundleServiceTest method testCreateDataSetNoDSEDefaults.
@Test
@Disabled
void testCreateDataSetNoDSEDefaults() throws IOException {
Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> metadata = renderService.fromMetadata(new ClassPathResource("dxf2/dataset_with_compulsory.json").getInputStream(), RenderFormat.JSON);
ObjectBundleParams params = new ObjectBundleParams();
params.setObjectBundleMode(ObjectBundleMode.COMMIT);
params.setImportStrategy(ImportStrategy.CREATE);
params.setObjects(metadata);
ObjectBundle bundle = objectBundleService.create(params);
ObjectBundleValidationReport validate = objectBundleValidationService.validate(bundle);
assertFalse(validate.hasErrorReports());
objectBundleService.commit(bundle);
List<DataSet> dataSets = manager.getAll(DataSet.class);
assertEquals(1, dataSets.size());
DataSet dataSet = dataSets.get(0);
assertEquals(dataSet.getDataSetElements().size(), 1);
DataSetElement dataSetElement = dataSet.getDataSetElements().iterator().next();
assertNull(dataSetElement.getCategoryCombo());
}
use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.
the class RemoveOperationTest method testRemoveInvalidKeyShouldThrowException.
@Disabled("for now we will allow 'removal' of invalid path keys")
@Test
void testRemoveInvalidKeyShouldThrowException() throws JsonProcessingException {
JsonPatch patch = jsonMapper.readValue("[" + "{\"op\": \"remove\", \"path\": \"/aaa\"}" + "]", JsonPatch.class);
assertNotNull(patch);
JsonNode root = jsonMapper.createObjectNode();
assertFalse(root.has("aaa"));
assertThrows(JsonPatchException.class, () -> patch.apply(root));
}
Aggregations