@@ -0,0 +1,2033 @@
+package com.b2international.snowowl.snomed.api.rest.versioning;%0A%0Aimport static com.b2international.snowowl.test.commons.rest.RestExtensions.givenAuthenticatedRequest;%0A%0Aimport java.util.Map;%0A%0Aimport org.junit.Test;%0A%0Aimport com.b2international.snowowl.snomed.api.rest.AbstractSnomedApiTest;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport com.jayway.restassured.http.ContentType;%0Aimport com.jayway.restassured.response.Response;%0Aimport com.jayway.restassured.specification.RequestSpecification;%0A%0Apublic class SnomedVersioningApiTest extends AbstractSnomedApiTest %7B%0A%0A%09@Test%0A%09public void getNonExistentVersion() %7B%0A%09%09assertVersionGetStatus(%22nonexistent%22, 404);%0A%09%7D%0A%09%0A%09@Test%0A%09public void createVersionWithoutDescription() %7B%0A%09%09assertVersionPostStatus(%22%22, %2220150201%22, 400);%0A%09%7D%0A%09%0A%09@Test%0A%09public void createVersionWithNonLatestEffectiveDate() %7B%0A%09%09assertVersionPostStatus(%22sct-v1%22, %2220150101%22, 400);%0A%09%7D%0A%09%0A%09@Test%0A%09public void createVersion() %7B%0A%09%09assertVersionPostStatus(%22sct-v2%22, %2220150201%22, 201);%0A%09%09assertVersionGetStatus(%22sct-v2%22, 200);%0A%09%7D%0A%09%0A%09@Test%0A%09public void createVersionWithSameNameAsBranch() %7B%0A%09%09assertBranchCanBeCreated(%22MAIN%22, %22sct-v3%22);%0A%09%09assertVersionPostStatus(%22sct-v2%22, %2220150202%22, 409);%0A%09%7D%0A%0A%09private void assertVersionGetStatus(String version, int status) %7B%0A%09%09givenAuthenticatedRequest(API)%0A%09%09.when()%0A%09%09%09.get(%22/codesystems/SNOMEDCT/versions/%7Bid%7D%22, version)%0A%09%09.then()%0A%09%09.assertThat()%0A%09%09%09.statusCode(status);%0A%09%7D%0A%0A%09private void assertVersionPostStatus(String version, String effectiveDate, int status) %7B%0A%09%09whenCreatingVersion(givenAuthenticatedRequest(API), version, effectiveDate)%0A%09%09.then()%0A%09%09.assertThat()%0A%09%09%09.statusCode(status);%0A%09%7D%0A%09%0A%09private Response whenCreatingVersion(RequestSpecification request, String version, String effectiveDate) %7B%0A%09%09Map%3C?, ?%3E requestBody = ImmutableMap.of(%0A%09%09%09%22version%22, version,%0A%09%09%09%22description%22, version,%0A%09%09%09%22effectiveDate%22, effectiveDate%0A%09%09);%0A%0A%09%09return request%0A%09%09.and()%0A%09%09%09.contentType(ContentType.JSON)%0A%09%09.and()%0A%09%09%09.body(requestBody)%0A%09%09.when()%0A%09%09%09.post(%22/codesystems/SNOMEDCT/versions%22);%0A%09%7D%0A%0A%7D

Add replacement test cases for versioning API