-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server side invite migration check for new teams
- Loading branch information
Showing
4 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
teams-server/src/test/java/teams/api/TeamControllerInviteMigrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package teams.api; | ||
|
||
import io.restassured.http.ContentType; | ||
import org.junit.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import teams.AbstractApplicationTest; | ||
import teams.domain.*; | ||
import teams.exception.DuplicateTeamNameException; | ||
import teams.exception.IllegalMembershipException; | ||
import teams.exception.NotAllowedException; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.apache.http.HttpStatus.*; | ||
import static org.hamcrest.Matchers.*; | ||
import static org.junit.Assert.*; | ||
import static org.springframework.http.HttpHeaders.CONTENT_TYPE; | ||
|
||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, | ||
properties = "features.invite-migration-on=true") | ||
public class TeamControllerInviteMigrationTest extends AbstractApplicationTest { | ||
|
||
@Test | ||
public void createTeamBadRequest() { | ||
given() | ||
.body(new NewTeamProperties("new team name", "Team champions ", null, true, true,false, | ||
null, Role.ADMIN.name(), null, Language.DUTCH)) | ||
.header(CONTENT_TYPE, "application/json") | ||
.when() | ||
.post("api/teams/teams") | ||
.then() | ||
.statusCode(SC_BAD_REQUEST); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters