[JAVA-14174] Renamed paterns to paterns-module (#12718)

* [JAVA-14174] Renamed paterns to paterns-module

* [JAVA-14174] naming fixes

Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com>
This commit is contained in:
panos-kakos
2022-09-19 07:44:14 +01:00
committed by GitHub
parent 74dcaa0935
commit 63a9bfbad9
518 changed files with 32 additions and 32 deletions
@@ -0,0 +1,29 @@
package com.baeldung.pattern.cleanarchitecture.usercreation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.junit.jupiter.api.Test;
import org.springframework.web.server.ResponseStatusException;
import com.baeldung.pattern.cleanarchitecture.usercreation.UserResponseFormatter;
import com.baeldung.pattern.cleanarchitecture.usercreation.UserResponseModel;
class UserResponseFormatterUnitTest {
UserResponseFormatter userResponseFormatter = new UserResponseFormatter();
@Test
void givenDateAnd3HourTime_whenPrepareSuccessView_thenReturnOnly3HourTime() {
UserResponseModel modelResponse = new UserResponseModel("baeldung", "2020-12-20T03:00:00.000");
UserResponseModel formattedResponse = userResponseFormatter.prepareSuccessView(modelResponse);
assertThat(formattedResponse.getCreationTime()).isEqualTo("03:00:00");
}
@Test
void whenPrepareFailView_thenThrowHttpConflictException() {
assertThatThrownBy(() -> userResponseFormatter.prepareFailView("Invalid password"))
.isInstanceOf(ResponseStatusException.class);
}
}
@@ -0,0 +1,15 @@
package com.baeldung.pattern.cleanarchitecture.usercreation;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
class UserUnitTest {
@Test
void given123Password_whenPasswordIsNotValid_thenIsFalse() {
User user = new CommonUser("Baeldung", "123");
assertThat(user.passwordIsValid()).isFalse();
}
}