Skip to content

Commit

Permalink
MET-5960 update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeortizquan committed Sep 18, 2024
1 parent fe0a46c commit 92dda8d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import eu.europeana.metis.debias.detect.model.error.ErrorDeBiasResult;
import eu.europeana.metis.debias.detect.model.request.DetectionParameter;
import eu.europeana.metis.debias.detect.model.response.DetectionDeBiasResult;
import eu.europeana.metis.debias.detect.rest.exceptions.DeBiasBadRequestException;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -113,12 +114,10 @@ void detect_errorResponse() throws IOException {
"a second addict sample title",
"this is a demo of master and slave branch"));

ErrorDeBiasResult detectionResult = (ErrorDeBiasResult) debiasClient.detect(detectionParameter);
DeBiasBadRequestException deBiasBadRequestException = assertThrows(DeBiasBadRequestException.class, () -> debiasClient.detect(detectionParameter));

assertNotNull(detectionResult.getDetailList().getFirst());
assertEquals("Input should be a valid string", detectionResult.getDetailList().getFirst().getMsg());
assertEquals("string_type", detectionResult.getDetailList().getFirst().getType());
assertEquals("https://errors.pydantic.dev/2.5/v/string_type", detectionResult.getDetailList().getFirst().getUrl());
assertNotNull(deBiasBadRequestException);
assertEquals("422 UNPROCESSABLE_ENTITY string_type Input should be a valid string", deBiasBadRequestException.getMessage());
}

@Test
Expand Down

0 comments on commit 92dda8d

Please sign in to comment.