Search in sources :

Example 61 with Disabled

use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.

the class InterpretationServiceTest method testCreateChartAndInterpretationSyncSharing.

// TODO enable
@Test
@Disabled
void testCreateChartAndInterpretationSyncSharing() throws IOException {
    UserGroup userGroup = createUserGroup('A', Sets.newHashSet(userA, userB));
    userGroupService.addUserGroup(userGroup);
    Visualization visualization = createVisualization('A');
    manager.save(visualization);
    visualization.setPublicAccess(AccessStringHelper.READ_WRITE);
    visualization.getSharing().addUserGroupAccess(new UserGroupAccess(userGroup, AccessStringHelper.READ));
    assertEquals(1, visualization.getUserGroupAccesses().size());
    manager.update(visualization);
    assertEquals(AccessStringHelper.READ_WRITE, visualization.getPublicAccess());
    assertEquals(1, visualization.getUserGroupAccesses().size());
    Interpretation interpretation = new Interpretation(visualization, null, "test");
    interpretationService.saveInterpretation(interpretation);
    interpretationService.updateInterpretation(interpretation);
    assertEquals(AccessStringHelper.READ_WRITE, interpretation.getPublicAccess());
    assertEquals(interpretation.getUserGroupAccesses().size(), visualization.getUserGroupAccesses().size());
}
Also used : Visualization(org.hisp.dhis.visualization.Visualization) UserGroup(org.hisp.dhis.user.UserGroup) UserGroupAccess(org.hisp.dhis.user.sharing.UserGroupAccess) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 62 with Disabled

use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.

the class SystemSettingsTests method returnDefaultValueWhenUserIsNotLoggedIn.

@Test
@Disabled("This test is broken and will only return 200 OK because the servlet redirects to the login page. //TODO: Remove")
public void returnDefaultValueWhenUserIsNotLoggedIn() {
    prepareData();
    // I need to log out
    loginActions.removeAuthenticationHeader();
    ApiResponse response = systemSettingActions.get(APPLICATION_INTRO_KEY, ContentType.TEXT.toString(), ContentType.TEXT.toString(), new QueryParamsBuilder());
    response.validate().statusCode(200);
}
Also used : QueryParamsBuilder(org.hisp.dhis.helpers.QueryParamsBuilder) ApiResponse(org.hisp.dhis.dto.ApiResponse) Test(org.junit.jupiter.api.Test) ApiTest(org.hisp.dhis.ApiTest) Disabled(org.junit.jupiter.api.Disabled)

Example 63 with Disabled

use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.

the class MetadataPatchTests method shouldReturnErrors.

@Disabled("DHIS2-11434")
@Test
public void shouldReturnErrors() {
    JsonObject object = JsonObjectBuilder.jsonObject().addProperty("op", "remove").addProperty("path", "/dataElementGroups").build();
    dataElementActions.patch(dataElementId, Arrays.asList(object), new QueryParamsBuilder().add("importReportMode", "ERRORS_NOT_OWNER")).validate().statusCode(200).body("response.errorReports", hasSize(1));
    dataElementActions.get(dataElementId).validate().body("dataElementGroups", hasSize(0));
}
Also used : QueryParamsBuilder(org.hisp.dhis.helpers.QueryParamsBuilder) JsonObject(com.google.gson.JsonObject) Test(org.junit.jupiter.api.Test) ApiTest(org.hisp.dhis.ApiTest) Disabled(org.junit.jupiter.api.Disabled)

Example 64 with Disabled

use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.

the class EventImportTest method testAddEventOnProgramWithoutRegistrationAndExistingProgramInstance.

/**
 * TODO: LUCIANO: this test has been ignored because the Importer should not
 * import an event linked to a Program with 2 or more Program Instances
 */
@Test
@Disabled
void testAddEventOnProgramWithoutRegistrationAndExistingProgramInstance() throws IOException {
    ProgramInstance pi = new ProgramInstance();
    pi.setEnrollmentDate(new Date());
    pi.setIncidentDate(new Date());
    pi.setProgram(programB);
    pi.setStatus(ProgramStatus.ACTIVE);
    pi.setStoredBy("test");
    programInstanceService.addProgramInstance(pi);
    InputStream is = createEventJsonInputStream(programB.getUid(), programStageB.getUid(), organisationUnitB.getUid(), null, dataElementB, "10");
    ImportSummaries importSummaries = eventService.addEventsJson(is, null);
    assertEquals(ImportStatus.SUCCESS, importSummaries.getStatus());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ProgramInstance(org.hisp.dhis.program.ProgramInstance) ImportSummaries(org.hisp.dhis.dxf2.importsummary.ImportSummaries) Date(java.util.Date) TransactionalIntegrationTest(org.hisp.dhis.TransactionalIntegrationTest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 65 with Disabled

use of org.junit.jupiter.api.Disabled in project dhis2-core by dhis2.

the class EnrollmentAttrValidationTest method testAttributesMissingTeA.

// TODO: Fails with: (need to figure out how to force deletion here first)
// * ERROR 22:47:50,353 Failed to invoke method deleteTrackedEntityAttribute
// on DeletionHandler 'ProgramDeletionHandler' (DefaultDeletionManager.java
// [main])
@Test
@Disabled("Delete not impl.")
void testAttributesMissingTeA() throws IOException {
    TrackedEntityAttribute sTJvSLN7Kcb = trackedEntityAttributeService.getTrackedEntityAttribute("sTJvSLN7Kcb");
    trackedEntityAttributeService.deleteTrackedEntityAttribute(sTJvSLN7Kcb);
    TrackerImportParams params = createBundleFromJson("tracker/validations/enrollments_te_attr-data.json");
    TrackerImportReport trackerImportReport = trackerImportService.importTracker(params);
    assertEquals(1, trackerImportReport.getValidationReport().getErrors().size());
    assertThat(trackerImportReport.getValidationReport().getErrors(), everyItem(hasProperty("errorCode", equalTo(TrackerErrorCode.E1006))));
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) TrackerImportReport(org.hisp.dhis.tracker.report.TrackerImportReport) TrackedEntityAttribute(org.hisp.dhis.trackedentity.TrackedEntityAttribute) 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