Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
6dbb8d6
fix: Update code
larshelge Jan 19, 2026
5e78bcf
merge: Merge from master branch
larshelge Jan 19, 2026
eef36e9
fix: Update code
larshelge Jan 21, 2026
2aeb160
fix: Update code
larshelge Jan 21, 2026
09e16f5
fix: Update code
larshelge Jan 22, 2026
22baaf0
fix: Update code
larshelge Jan 22, 2026
65e4c6a
fix: Update code
larshelge Jan 22, 2026
6733363
fix: Update code
larshelge Jan 22, 2026
f0670b2
merge: Merge from master branch
larshelge Jan 22, 2026
bcb9517
merge: Merge from master branch
larshelge Jan 22, 2026
524576b
fix: Update code
larshelge Jan 26, 2026
76803c8
fix: Update code
larshelge Jan 27, 2026
6a2afb8
fix: Update code
larshelge Jan 27, 2026
996e4ac
fix: Update code
larshelge Jan 27, 2026
e73e9cc
merge: Merge from master branch
larshelge Jan 27, 2026
adcd707
fix: Update code
larshelge Jan 27, 2026
b895778
merge: Merge from master branch
larshelge Jan 27, 2026
baed0e5
fix: Update code
larshelge Jan 27, 2026
efe180f
fix: Update code
larshelge Jan 27, 2026
733abac
fix: Update code
larshelge Jan 27, 2026
dbbc958
merge: Merge from master branch
larshelge Jan 27, 2026
947da72
fix: Update code
larshelge Jan 27, 2026
13005f5
fix: Update code
larshelge Feb 2, 2026
6adf1d1
fix: Update code
larshelge Feb 18, 2026
a2124a4
fix: Update code
larshelge Feb 18, 2026
3860d11
merge: Merge from master branch
larshelge Feb 18, 2026
1b3b4ff
fix: Update code
larshelge Feb 23, 2026
7e988a8
merge: Merge from master branch
larshelge Feb 23, 2026
72e2b9c
fix: Update code
larshelge Feb 25, 2026
b296677
fix: Update code
larshelge Feb 25, 2026
151ed4f
chore: Bump version
larshelge Feb 25, 2026
6208073
merge: Merge from master branch
larshelge Feb 25, 2026
24a18c3
merge: Merge from master branch
larshelge Feb 25, 2026
cc0ac36
fix: Add test
larshelge Feb 26, 2026
7f2016f
fix: Update code
larshelge Feb 26, 2026
7c02d20
fix: Update code
larshelge Feb 26, 2026
d8a8d5f
merge: Merge from master branch
larshelge Feb 26, 2026
a7568f5
fix: Update code
larshelge Mar 4, 2026
8b4b947
merge: Merge from master branch
larshelge Mar 4, 2026
9fc6e7a
fix: Update code
larshelge Mar 6, 2026
a537088
fix: Update code
larshelge Mar 6, 2026
f18110f
merge: Merge from master branch
larshelge Mar 6, 2026
0249573
merge: Merge from master branch
larshelge Mar 6, 2026
c3b96d4
fix: Update code
larshelge Mar 6, 2026
136d976
merge: Merge from master branch
larshelge Mar 6, 2026
ab9a0ae
fix: Update code
larshelge Mar 7, 2026
247b74b
merge: Merge from master branch
larshelge Mar 7, 2026
6c1d0c8
merge: Merge from master branch
larshelge Mar 7, 2026
437749e
fix: Update code
larshelge Mar 8, 2026
9bd01ae
fix: Update code
larshelge Mar 8, 2026
6cb5cc4
merge: Merge from master branch
larshelge Mar 8, 2026
4cfcbcf
fix: Add util method
larshelge Mar 9, 2026
717f095
merge: Merge from master branch
larshelge Mar 9, 2026
bc14846
fix: Update code
larshelge Mar 9, 2026
cef6eb5
merge: Merge from master branch
larshelge Mar 9, 2026
1880d03
fix: Update code
larshelge Mar 10, 2026
880061e
merge: Merge from master branch
larshelge Mar 10, 2026
485c297
fix: Update code
larshelge Mar 12, 2026
7f4556d
merge: Merge from master branch
larshelge Mar 12, 2026
542a7ec
fix: Update code
larshelge Mar 13, 2026
7cc77e8
fix: Update code
larshelge Mar 13, 2026
2bea5cb
fix: Update code
larshelge Mar 13, 2026
92744b9
merge: Merge from master branch
larshelge Mar 13, 2026
5a3edef
fix: Update code
larshelge Mar 13, 2026
5712164
merge: Merge from master branch
larshelge Mar 13, 2026
b78faf2
fix: Update code
larshelge Apr 6, 2026
53b2015
fix: Update code
larshelge Apr 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean hasImportCount() {
/**
* Returns the total count including imported, updated, deleted and ignored data values.
*
* @return a total count.
* @return the total count.
*/
@JsonIgnore
private long getTotalCount() {
Expand All @@ -78,6 +78,17 @@ private long getTotalCount() {
: 0;
}

/**
* Returns the affected count including imported, updated and deleted data values.
*
* @return the affected count.
*/
public long getAffectedCount() {
return hasImportCount()
? (importCount.getImported() + importCount.getUpdated() + importCount.getDeleted())
: 0;
}

@Override
public String toString() {
return newToStringBuilder(this, super.toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* Copyright (c) 2004-2025, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hisp.dhis.response.data;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.hisp.dhis.response.datavalueset.DataValueSetResponse;
import org.hisp.dhis.support.TestTags;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TestTags.UNIT)
class AsyncSummaryResponseTest {
@Test
void testHasImportCountWhenNull() {
DataValueSetResponse response = new DataValueSetResponse();

assertFalse(response.hasImportCount());
}

@Test
void testHasImportCountWhenPresent() {
DataValueSetResponse response = new DataValueSetResponse();
response.setImportCount(new ImportCount());

assertTrue(response.hasImportCount());
}

@Test
void testGetAffectedCountWhenNoImportCount() {
DataValueSetResponse response = new DataValueSetResponse();

assertEquals(0, response.getAffectedCount());
}

@Test
void testGetAffectedCount() {
ImportCount importCount = new ImportCount();
importCount.setImported(5);
importCount.setUpdated(3);
importCount.setDeleted(2);
importCount.setIgnored(4);

DataValueSetResponse response = new DataValueSetResponse();
response.setImportCount(importCount);

assertEquals(10, response.getAffectedCount());
}

@Test
void testGetAffectedCountExcludesIgnored() {
ImportCount importCount = new ImportCount();
importCount.setImported(2);
importCount.setUpdated(1);
importCount.setDeleted(0);
importCount.setIgnored(10);

DataValueSetResponse response = new DataValueSetResponse();
response.setImportCount(importCount);

assertEquals(3, response.getAffectedCount());
}

@Test
void testStatusAndDescription() {
DataValueSetResponse response = new DataValueSetResponse();
response.setStatus(Status.SUCCESS);
response.setDescription("Import successful");

assertEquals(Status.SUCCESS, response.getStatus());
assertEquals("Import successful", response.getDescription());
}

@Test
void testConflictsDefaultEmpty() {
DataValueSetResponse response = new DataValueSetResponse();

assertTrue(response.getConflicts().isEmpty());
}
}
Loading