Skip to content

Commit

Permalink
MODINVSTOR-1262 improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-barannyk committed Nov 11, 2024
1 parent 87b9b1c commit 7369163
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,33 @@ void shouldReturnFalseIfServicePointIsNull() {

@Test
void shouldReturnFalseIfServicePointsAreIdentical() {
Servicepoint servicepoint = new Servicepoint();
var servicepoint = new Servicepoint();
var updateEventProcessor = new ServicePointSynchronizationUpdateEventProcessor(
updateEvent(servicepoint, servicepoint, TENANT));

assertFalse(updateEventProcessor.validateEventEntity());
}

@Test
void shouldReturnTrueIfNewServicePointIsValid() {
Servicepoint oldServicepoint = new Servicepoint().withId(UUID.randomUUID().toString());
Servicepoint newServicepoint = new Servicepoint().withId(UUID.randomUUID().toString());
void shouldReturnTrueForUpdateIfNewServicePointIsValid() {
var oldServicepoint = new Servicepoint().withId(UUID.randomUUID().toString());
var newServicepoint = new Servicepoint().withId(UUID.randomUUID().toString());

var updateEventProcessor = new ServicePointSynchronizationUpdateEventProcessor(
updateEvent(oldServicepoint, newServicepoint, TENANT));

assertTrue(updateEventProcessor.validateEventEntity());
}

@Test
void shouldReturnTrueForCreateIfNewServicePointIsValid() {
var servicepoint = new Servicepoint().withId(UUID.randomUUID().toString());
var createEventProcessor = new ServicePointSynchronizationCreateEventProcessor(
createEvent(servicepoint, TENANT));

assertTrue(createEventProcessor.validateEventEntity());
}

@Test
void shouldReturnFalseIfValidationMessageIsNotNull() {
Servicepoint oldServicepoint = new Servicepoint();
Expand Down

0 comments on commit 7369163

Please sign in to comment.