Skip to content

Commit

Permalink
add a test to make sonar happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadshadab committed Sep 29, 2023
1 parent c9251ba commit 4fa0e23
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void testCreateObject() {
assertEquals("description", dbType.getAttributes().get(0).getXmlTag());
Assertions.assertNull(dbType.getAttributes().get(0).getUriLink());
assertEquals(this.idMappingName, dbType.getIdMappingName());
assertEquals(this.type, dbType.getType());
}

@Test
Expand Down Expand Up @@ -105,6 +104,15 @@ void needDefaultConstructorForJsonDeserialization() {
assertNull(obj.getType());
}

@Test
void testCreateObjectWithType(){
UniProtDatabaseDetail dbDetails = new UniProtDatabaseDetail(this.name, this.displayName,
this.category, this.uriLink, this.attributes, false,
null, this.idMappingName, this.type);
assertNotNull(dbDetails);
assertEquals(this.type, dbDetails.getType());
}

private UniProtDatabaseDetail createUniProtDatabaseDetail(boolean passAttribute) {
if (passAttribute) {
return createUniProtDatabaseDetail(
Expand All @@ -113,7 +121,6 @@ private UniProtDatabaseDetail createUniProtDatabaseDetail(boolean passAttribute)
this.category,
this.uriLink,
this.attributes,
null,
null);
} else {
return createUniProtDatabaseDetail(
Expand All @@ -122,8 +129,7 @@ private UniProtDatabaseDetail createUniProtDatabaseDetail(boolean passAttribute)
this.category,
this.uriLink,
null,
this.idMappingName,
this.type);
this.idMappingName);
}
}

Expand All @@ -133,9 +139,8 @@ static UniProtDatabaseDetail createUniProtDatabaseDetail(
UniProtDatabaseCategory category,
String uriLink,
List<UniProtDatabaseAttribute> attributes,
String idMappingName,
String type) {
String idMappingName) {
return new UniProtDatabaseDetail(
name, displayName, category, uriLink, attributes, false, null, idMappingName, type);
name, displayName, category, uriLink, attributes, false, null, idMappingName);
}
}

0 comments on commit 4fa0e23

Please sign in to comment.