Skip to content

Commit 9f36ee5

Browse files
committed
work
1 parent 52ba078 commit 9f36ee5

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

src/test/java/org/woehlke/java/simpleworklist/domain/UserPasswordRecoveryControllerIT.java

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,14 @@ public void runAfterTestClass() {
145145
@Test
146146
public void testResetPassword() {
147147
try {
148+
String url = "/user/resetPassword/form";
149+
log.info(eyecatcherH2);
150+
log.info(url);
151+
log.info(eyecatcherH2);
148152
this.mockMvc.perform(
149-
get("/user/resetPassword/form")).andDo(print())
153+
get(url)).andDo(print())
150154
.andExpect(view().name(containsString("user/resetPassword/resetPasswordForm")));
155+
log.info(eyecatcherH2);
151156
} catch (Exception ex) {
152157
log.warn("Exception: " + ex.getLocalizedMessage());
153158
for (StackTraceElement e : ex.getStackTrace()) {
@@ -160,9 +165,14 @@ public void testResetPassword() {
160165
@Test
161166
public void testEnterNewPasswordFormular() {
162167
try {
168+
String url ="/user/resetPassword/confirm/ASDF";
169+
log.info(eyecatcherH2);
170+
log.info(url);
171+
log.info(eyecatcherH2);
163172
this.mockMvc.perform(
164-
get("/user/resetPassword/confirm/ASDF")).andDo(print())
173+
get(url)).andDo(print())
165174
.andExpect(view().name(containsString("user/resetPassword/resetPasswordNotConfirmed")));
175+
log.info(eyecatcherH2);
166176
} catch (Exception ex) {
167177
log.warn("Exception: " + ex.getLocalizedMessage());
168178
for (StackTraceElement e : ex.getStackTrace()) {
@@ -181,17 +191,22 @@ public void testEnterNewPasswordFormularWithToken() {
181191
e.printStackTrace();
182192
}
183193
try {
184-
UserAccountPasswordRecovery o = testHelperService.findPasswordRecoveryByEmail(emails[0]);
185-
assertNotNull(o);
186-
boolean result = o.getDoubleOptInStatus()== UserAccountPasswordRecoveryStatus.PASSWORD_RECOVERY_SAVED_EMAIL
187-
|| o.getDoubleOptInStatus()== UserAccountPasswordRecoveryStatus.PASSWORD_RECOVERY_SENT_EMAIL;
188-
assertTrue(result);
189-
String url = "/user/resetPassword/confirm/"+o.getToken();
190-
this.mockMvc.perform(
194+
UserAccountPasswordRecovery o = testHelperService.findPasswordRecoveryByEmail(emails[0]);
195+
assertNotNull(o);
196+
boolean result = o.getDoubleOptInStatus()== UserAccountPasswordRecoveryStatus.PASSWORD_RECOVERY_SAVED_EMAIL
197+
|| o.getDoubleOptInStatus()== UserAccountPasswordRecoveryStatus.PASSWORD_RECOVERY_SENT_EMAIL;
198+
assertTrue(result);
199+
String url = "/user/resetPassword/confirm/"+o.getToken();
200+
log.info(eyecatcherH2);
201+
log.info(url);
202+
log.info(eyecatcherH2);
203+
this.mockMvc.perform(
191204
get(url)).andDo(print())
192205
.andExpect(view().name(containsString("user/resetPassword/resetPasswordConfirmed")))
193206
.andExpect(model().attributeExists("userAccountFormBean"));
207+
log.info(eyecatcherH2);
194208
userAccountPasswordRecoveryService.passwordRecoveryDone(o);
209+
log.info(eyecatcherH2);
195210
} catch (Exception ex) {
196211
log.warn("Exception: " + ex.getLocalizedMessage());
197212
for (StackTraceElement e : ex.getStackTrace()) {

0 commit comments

Comments
 (0)