Search in sources :

Example 11 with QNameApiData

use of org.eclipse.winery.repository.rest.resources.apiData.QNameApiData in project winery by eclipse.

the class ServiceTemplateResourceTest method createNewStatefulVersion.

@Test
public void createNewStatefulVersion() throws Exception {
    this.setRevisionTo("eb37f5cfec50c046985eac308e46482ce8bea8e3");
    String response = this.assertPostWithNoContent("servicetemplates/http%253A%252F%252Fplain.winery.opentosca.org%252Fservicetemplates/ServiceTemplateWithOneNodeTemplate_w1-wip1/createnewstatefulversion", ContentType.JSON);
    QNameApiData newId = JacksonProvider.mapper.readValue(response, QNameApiData.class);
    assertNonNull(newId);
    WineryVersion version = VersionUtils.getVersion(newId.localname);
    assertNonNull(version);
    assertTrue(version.getComponentVersion().startsWith("stateful-w1-wip1-"));
}
Also used : QNameApiData(org.eclipse.winery.repository.rest.resources.apiData.QNameApiData) WineryVersion(org.eclipse.winery.common.version.WineryVersion) Test(org.junit.jupiter.api.Test) AbstractResourceTest(org.eclipse.winery.repository.rest.resources.AbstractResourceTest)

Aggregations

QNameApiData (org.eclipse.winery.repository.rest.resources.apiData.QNameApiData)11 Path (javax.ws.rs.Path)6 Produces (javax.ws.rs.Produces)6 WineryVersion (org.eclipse.winery.common.version.WineryVersion)6 ArrayList (java.util.ArrayList)5 POST (javax.ws.rs.POST)5 ServiceTemplateId (org.eclipse.winery.model.ids.definitions.ServiceTemplateId)5 ResourceResult (org.eclipse.winery.repository.rest.resources._support.ResourceResult)5 IRepository (org.eclipse.winery.repository.backend.IRepository)3 QNameConverter (org.eclipse.winery.repository.rest.resources.apiData.converter.QNameConverter)3 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 TServiceTemplate (org.eclipse.winery.model.tosca.TServiceTemplate)2 TTag (org.eclipse.winery.model.tosca.TTag)2 TTopologyTemplate (org.eclipse.winery.model.tosca.TTopologyTemplate)2 OTParticipant (org.eclipse.winery.model.tosca.extensions.OTParticipant)2 Splitting (org.eclipse.winery.repository.splitting.Splitting)2 ApiResponse (io.swagger.annotations.ApiResponse)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1