Skip to content

Commit

Permalink
Test with a non-existent float
Browse files Browse the repository at this point in the history
  • Loading branch information
virustotalop committed Feb 7, 2023
1 parent f7878b3 commit ac8f7f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,11 @@ public void testInjectorNonExistent() {
config.inject(mock);
assertEquals(null, mock.getNonExistent());
}

@Test
public void testInjectorNonExistentFloat() {
ConfigHolderNonStaticMock mock = new ConfigHolderNonStaticMock();
config.inject(mock);
assertEquals(0.0f, mock.getNonExistentFloat(), 0.01f);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class ConfigHolderNonStaticMock implements ConfigHolder {
@Node("non-existent")
private String nonExistent;

@Node("non-existent-float")
private float nonExistentFloat;

@Node(value = "day-map", type = DayOfWeek.class, valueType = Integer.class)
private Map<DayOfWeek, Integer> dayMap;

Expand Down Expand Up @@ -78,6 +81,10 @@ public String getNonExistent() {
return this.nonExistent;
}

public float getNonExistentFloat() {
return this.nonExistentFloat;
}

public MockHolder getHolder() {
return this.holder;
}
Expand Down

0 comments on commit ac8f7f7

Please sign in to comment.