fixed tests
This commit is contained in:
		
							parent
							
								
									870eaffe8c
								
							
						
					
					
						commit
						e4b31a392c
					
				
					 2 changed files with 24 additions and 3 deletions
				
			
		|  | @ -156,6 +156,21 @@ public class APIMessage implements Serializable { | ||||||
|         return this.attributes; |         return this.attributes; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @Override | ||||||
|  |     public String toString() { | ||||||
|  |         final StringBuilder builder = new StringBuilder(); | ||||||
|  |         builder.append("APIMessage [messageCode="); | ||||||
|  |         builder.append(this.messageCode); | ||||||
|  |         builder.append(", systemMessage="); | ||||||
|  |         builder.append(this.systemMessage); | ||||||
|  |         builder.append(", details="); | ||||||
|  |         builder.append(this.details); | ||||||
|  |         builder.append(", attributes="); | ||||||
|  |         builder.append(this.attributes); | ||||||
|  |         builder.append("]"); | ||||||
|  |         return builder.toString(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** Use this as a conversion from a given FieldError of Spring to a APIMessage |     /** Use this as a conversion from a given FieldError of Spring to a APIMessage | ||||||
|      * of type field validation. |      * of type field validation. | ||||||
|      * |      * | ||||||
|  |  | ||||||
|  | @ -10,6 +10,9 @@ package ch.ethz.seb.sebserver.gui.integration; | ||||||
| 
 | 
 | ||||||
| import static org.junit.Assert.*; | import static org.junit.Assert.*; | ||||||
| 
 | 
 | ||||||
|  | import java.util.Locale; | ||||||
|  | 
 | ||||||
|  | import org.joda.time.DateTimeZone; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.jupiter.api.AfterAll; | import org.junit.jupiter.api.AfterAll; | ||||||
| import org.junit.jupiter.api.BeforeAll; | import org.junit.jupiter.api.BeforeAll; | ||||||
|  | @ -111,7 +114,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { | ||||||
| 
 | 
 | ||||||
|         assertNotNull(instId); |         assertNotNull(instId); | ||||||
| 
 | 
 | ||||||
|         final UserInfo userInfo = restService.getBuilder(NewUserAccount.class) |         final Result<UserInfo> result = restService.getBuilder(NewUserAccount.class) | ||||||
|                 .withFormParam(Domain.USER.ATTR_INSTITUTION_ID, instId) |                 .withFormParam(Domain.USER.ATTR_INSTITUTION_ID, instId) | ||||||
|                 .withFormParam(Domain.USER.ATTR_NAME, "TestInstAdmin") |                 .withFormParam(Domain.USER.ATTR_NAME, "TestInstAdmin") | ||||||
|                 .withFormParam(Domain.USER.ATTR_USERNAME, "TestInstAdmin") |                 .withFormParam(Domain.USER.ATTR_USERNAME, "TestInstAdmin") | ||||||
|  | @ -119,9 +122,12 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { | ||||||
|                 .withFormParam(Domain.USER_ROLE.REFERENCE_NAME, UserRole.INSTITUTIONAL_ADMIN.name()) |                 .withFormParam(Domain.USER_ROLE.REFERENCE_NAME, UserRole.INSTITUTIONAL_ADMIN.name()) | ||||||
|                 .withFormParam(PasswordChange.ATTR_NAME_NEW_PASSWORD, "12345678") |                 .withFormParam(PasswordChange.ATTR_NAME_NEW_PASSWORD, "12345678") | ||||||
|                 .withFormParam(PasswordChange.ATTR_NAME_CONFIRM_NEW_PASSWORD, "12345678") |                 .withFormParam(PasswordChange.ATTR_NAME_CONFIRM_NEW_PASSWORD, "12345678") | ||||||
|                 .call() |                 .withFormParam(Domain.USER.ATTR_LANGUAGE, Locale.ENGLISH.getLanguage()) | ||||||
|                 .getOrThrow(); |                 .withFormParam(Domain.USER.ATTR_TIMEZONE, DateTimeZone.UTC.getID()) | ||||||
|  |                 .call(); | ||||||
| 
 | 
 | ||||||
|  |         assertFalse(result.hasError()); | ||||||
|  |         final UserInfo userInfo = result.get(); | ||||||
|         assertNotNull(userInfo); |         assertNotNull(userInfo); | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 anhefti
						anhefti