Skip to content

Commit

Permalink
Merge v5 branch changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-vd committed Jan 31, 2023
1 parent 14e7f3d commit 46eac64
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.smartregister.clientandeventmodel.populateform;

import org.junit.Assert;
import org.junit.Test;
import org.smartregister.BaseUnitTest;
import org.smartregister.clientandeventmodel.populateform.Model;

public class ModelTest extends BaseUnitTest {


@Test
public void testConstructorNotNull() {
Model model = new Model("","","","");
Assert.assertNotNull(model);
}

}
10 changes: 10 additions & 0 deletions opensrp-core/src/test/java/org/smartregister/util/UtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -719,5 +719,15 @@ public void testComposeApiCallParamsStringWithMultipleParamValues() {
apiParams.add(Pair.create("serverVersion", "21"));
assertEquals("&identifier=global_configs&serverVersion=21", Utils.composeApiCallParamsString(apiParams));
}

@Test
public void testTryParseLongShouldParseCorrectly() {
assertEquals(123L, (Long) Utils.tryParseLong("123", 0), 0);
}

@Test
public void testTryParseLongShouldParseShoouldReturnDefaultValueOnException() {
assertEquals(0L, (Long) Utils.tryParseLong("xyz", 0), 0);
}
}

0 comments on commit 46eac64

Please sign in to comment.