Skip to content

Commit

Permalink
Add Query/Command unit backend tests
Browse files Browse the repository at this point in the history
RISDEV-0000
  • Loading branch information
VictorDelCampo committed Mar 6, 2024
1 parent 21a81bc commit ca5f168
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.input;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadAmendingLawXmlQueryTest {

@Test
void canCreateQueryWithEli() {
// Given
final String eli = "someEli";

// When
final LoadAmendingLawXmlUseCase.Query query = new LoadAmendingLawXmlUseCase.Query(eli);

// Then
assertThat(query.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.bund.digitalservice.ris.norms.application.port.input;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadArticleQueryTest {

@Test
void canCreateQueryWithEliAndEId() {
// Given
final String eli = "someEli";
final String eId = "someEId";

// When
final LoadArticleUseCase.Query query = new LoadArticleUseCase.Query(eli, eId);

// Then
assertThat(query.eli()).isEqualTo(eli);
assertThat(query.eId()).isEqualTo(eId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.input;

import static org.assertj.core.api.Assertions.*;

import org.junit.jupiter.api.Test;

class LoadArticlesQueryTest {

@Test
void canCreateQueryWithEli() {
// Given
final String eli = "someEli";

// When
final LoadArticlesUseCase.Query query = new LoadArticlesUseCase.Query(eli);

// Then
assertThat(query.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.input;

import static org.assertj.core.api.Assertions.*;

import org.junit.jupiter.api.Test;

class LoadTargetLawQueryTest {

@Test
void canCreateQueryWithEli() {
// Given
final String eli = "someEli";

// When
final LoadTargetLawUseCase.Query query = new LoadTargetLawUseCase.Query(eli);

// Then
assertThat(query.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.input;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadTargetLawXmlQueryTest {

@Test
void canCreateQueryWithEli() {
// Given
final String eli = "someEli";

// When
final LoadTargetLawXmlUseCase.Query query = new LoadTargetLawXmlUseCase.Query(eli);

// Then
assertThat(query.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.output;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadAmendingLawXmlCommandTest {

@Test
void canCreateCommandWithEli() {
// Given
final String eli = "someEli";

// When
final LoadAmendingLawXmlPort.Command command = new LoadAmendingLawXmlPort.Command(eli);

// Then
assertThat(command.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.bund.digitalservice.ris.norms.application.port.output;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadArticleCommandTest {

@Test
void canCreateCommandWithEliAndEid() {
// Given
final String eli = "someEli";
final String eId = "someEId";

// When
final LoadArticlePort.Command command = new LoadArticlePort.Command(eli, eId);

// Then
assertThat(command.eli()).isEqualTo(eli);
assertThat(command.eId()).isEqualTo(eId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.output;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadArticlesCommandTest {

@Test
void canCreateCommandWithEli() {
// Given
final String eli = "someEli";

// When
final LoadArticlesPort.Command command = new LoadArticlesPort.Command(eli);

// Then
assertThat(command.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package de.bund.digitalservice.ris.norms.application.port.output;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadTargetLawCommandTest {

@Test
void canCreateCommandWithEli() {
// Given
final String eli = "someEli";
// When
final LoadTargetLawPort.Command command = new LoadTargetLawPort.Command(eli);

// Then
assertThat(command.eli()).isEqualTo(eli);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.bund.digitalservice.ris.norms.application.port.output;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class LoadTargetLawXmlCommandTest {

@Test
void canCreateCommandWithEli() {
// Given
final String eli = "someEli";

// When
final LoadTargetLawPort.Command command = new LoadTargetLawPort.Command(eli);

// Then
assertThat(command.eli()).isEqualTo(eli);
}
}

0 comments on commit ca5f168

Please sign in to comment.