Skip to content

Commit

Permalink
refactor: resolve a bunch of code smells
Browse files Browse the repository at this point in the history
RISDEV-3828
  • Loading branch information
andreasphil committed May 23, 2024
1 parent e5b03f4 commit 1703e4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import de.bund.digitalservice.ris.norms.utils.XmlMapper;
import java.util.NoSuchElementException;
import org.junit.jupiter.api.Test;

public class ElementResponseMapperTest {
class ElementResponseMapperTest {
@Test
void convertsAnArticleNode() {
// Given
Expand Down Expand Up @@ -96,7 +97,7 @@ void convertsAnArticleWithoutTitleToNode() {
var output = ElementResponseMapper.fromElementNode(node);

// Then
assertThat(output.getTitle()).isEqualTo("");
assertThat(output.getTitle()).isEmpty();
assertThat(output.getEid()).isEqualTo("hauptteil-1_para-1");
assertThat(output.getType()).isEqualTo("article");
}
Expand Down Expand Up @@ -177,7 +178,7 @@ void convertsAnArbitraryNode() {
var output = ElementResponseMapper.fromElementNode(node);

// Then
assertThat(output.getTitle()).isEqualTo("");
assertThat(output.getTitle()).isEmpty();
assertThat(output.getEid()).isEqualTo("random-1");
assertThat(output.getType()).isEqualTo("someRandomNode");
}
Expand All @@ -195,6 +196,7 @@ void throwsWhenConvertingANodeWithoutEid() {
""");

// When
assertThatThrownBy(() -> ElementResponseMapper.fromElementNode(node));
assertThatThrownBy(() -> ElementResponseMapper.fromElementNode(node))
.isInstanceOf(NoSuchElementException.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ void cleanUp() {
normRepository.deleteAll();
}

// TODO Hannes: Adjust OpenAPI documentation
@Nested
class GetElement {
@Test
Expand Down Expand Up @@ -261,9 +260,6 @@ void itReturnsOnlyTheElementsMatchingTheGivenAmendingLaw() throws Exception {
+ "&type=article"
+ "&type=conclusions"
+ "&amendedBy=eli/bund/bgbl-1/2017/s815/1995-03-15/1/deu/regelungstext-1"; // second
// mod
// source
// eli

// when
mockMvc
Expand Down

0 comments on commit 1703e4e

Please sign in to comment.