Skip to content

Commit

Permalink
Fixing unit tests due to latest changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <[email protected]>
  • Loading branch information
sgup432 committed Apr 5, 2022
1 parent eb09ab5 commit 5ae5003
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public String getName() {
*/
@Nullable
public static HotClusterSummary buildSummary(Record record) {
if (record == null) {
return null;
}
HotClusterSummary summary = null;
try {
Integer numOfNodes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ public String getName() {
*/
@Nullable
public static HotResourceSummary buildSummary(Record record) {
if (record == null) {
return null;
}
HotResourceSummary summary = null;
try {
int resourceTypeEnumVal =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ public String getName() {
*/
@Nullable
public static HotShardSummary buildSummary(final Record record) {
if (record == null) {
return null;
}
HotShardSummary summary = null;
try {
String indexName =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public long getTimeStamp() {
}

public static RcaResponse buildResponse(Record record) {
if (record == null) {
return null;
}
RcaResponse response = null;
try {
String rcaName =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ public void testBuildResponseDurability() {
Mockito.when(record.get(isA(Field.class), any(Class.class)))
.thenThrow(new DataTypeException("uh-oh"));
Assert.assertNull(RcaResponse.buildResponse(record));
Mockito.when(record.get(isA(Field.class), any(Class.class)))
.thenThrow(new NullPointerException());
Assert.assertNull(RcaResponse.buildResponse(record));
Assert.assertNull(RcaResponse.buildResponse(null));
}

@Test
Expand Down

0 comments on commit 5ae5003

Please sign in to comment.