Skip to content

Commit

Permalink
Sonar review
Browse files Browse the repository at this point in the history
  • Loading branch information
samleeflang committed May 14, 2024
1 parent dcf9fa4 commit 92e6613
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,38 @@ void testRetrieve() {
assertThat(result).isEqualTo(SPECIMEN_NAME);
}


@Test
void testRetrieveVernacular() {
// Given
var ds = new eu.dissco.core.translator.schema.DigitalSpecimen()
.withDwcIdentification(List.of(
new eu.dissco.core.translator.schema.Identifications()
.withDwcIdentificationVerificationStatus(Boolean.TRUE)
.withTaxonIdentifications(
List.of(new TaxonIdentification().withDwcVernacularName(SPECIMEN_NAME)))
));

// When
var result = specimenName.calculate(ds);

// Then
assertThat(result).isEqualTo(SPECIMEN_NAME);
}

@Test
void testRetrieveNoName() {
// Given
var ds = new eu.dissco.core.translator.schema.DigitalSpecimen()
.withDwcIdentification(List.of());

// When
var result = specimenName.calculate(ds);

// Then
assertThat(result).isNull();
}

@Test
void testGetTerm() {
// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class VerbatimCoordinateSystemTest {
class VerbatimCoordinateSystemTest {

private static final String VERBATIM_COORDINATE_SYSTEM = "degrees decimal minutes";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class VerbatimCoordinatesTest {
class VerbatimCoordinatesTest {

private static final String VERBATIM_COORDINATES = "41 05 54S 121 05 34W";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class VerbatimLatitudeTest {
class VerbatimLatitudeTest {

private static final String VERBATIM_LATITUDE = "41 05 54.03S";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class VerbatimLongitudeTest {
class VerbatimLongitudeTest {

private static final String VERBATIM_LONGITUDE = "121d 10' 34\" W";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class VerbatimSRSTest {
class VerbatimSRSTest {

private static final String VERBATIM_SRS = "NAD27";

Expand Down

0 comments on commit 92e6613

Please sign in to comment.