Search in sources :

Example 66 with Disabled

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());
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) TrackedEntity(org.hisp.dhis.tracker.domain.TrackedEntity) Enrollment(org.hisp.dhis.tracker.domain.Enrollment) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 67 with Disabled

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());
}
Also used : ImportSummary(org.hisp.dhis.dxf2.importsummary.ImportSummary) Enrollment(org.hisp.dhis.dxf2.events.enrollment.Enrollment) Event(org.hisp.dhis.dxf2.events.event.Event) TrackedEntityInstance(org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 68 with Disabled

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()));
}
Also used : DataElement(org.hisp.dhis.dataelement.DataElement) Timer(org.hisp.dhis.util.Timer) ArrayList(java.util.ArrayList) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 69 with Disabled

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());
}
Also used : ObjectBundleValidationReport(org.hisp.dhis.dxf2.metadata.objectbundle.feedback.ObjectBundleValidationReport) DataSet(org.hisp.dhis.dataset.DataSet) List(java.util.List) DataSetElement(org.hisp.dhis.dataset.DataSetElement) ClassPathResource(org.springframework.core.io.ClassPathResource) IdentifiableObject(org.hisp.dhis.common.IdentifiableObject) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 70 with Disabled

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));
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) JsonPatch(org.hisp.dhis.commons.jackson.jsonpatch.JsonPatch) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)228 Test (org.junit.jupiter.api.Test)214 File (java.io.File)13 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)9 NAR (nars.NAR)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 BaseDataTest (org.apache.ibatis.BaseDataTest)8 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7 SqlSession (org.apache.ibatis.session.SqlSession)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 AnswerSet (at.ac.tuwien.kr.alpha.api.AnswerSet)6 ASPCore2Program (at.ac.tuwien.kr.alpha.api.programs.ASPCore2Program)6 FieldValueModel (com.synopsys.integration.alert.common.rest.model.FieldValueModel)6 IntegrationPerformanceTestRunner (com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner)6 List (java.util.List)6 RectDouble2D (jcog.tree.rtree.rect.RectDouble2D)6