Search in sources :

Example 1 with WriteContext

use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.

the class PublishStatusCtl method commit.

private ResponseEntity<PublishStatusApi.Receipt> commit(String requestId, String operatorId, String ownerId, String stability, PublishStatusApi.Form form) {
    form.setStability(stability);
    WriteContext context = buildContext(requestId, operatorId, ownerId);
    return CommitApiCaller.sync(api, context, form);
}
Also used : WriteContext(one.kii.summer.io.context.WriteContext)

Example 2 with WriteContext

use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.

the class RefreshStatusCtl method commit.

private ResponseEntity<RefreshStatusApi.Receipt> commit(String requestId, String operatorId, String ownerId, String subId, MultiValueMap<String, String> map) {
    WriteContext context = buildContext(requestId, ownerId, operatorId);
    RefreshStatusApi.SubIdForm form = new RefreshStatusApi.SubIdForm();
    form.setSubId(subId);
    form.setMap(map);
    return CommitApiCaller.sync(api, context, form);
}
Also used : RefreshStatusApi(one.kii.kiimate.status.core.api.RefreshStatusApi) WriteContext(one.kii.summer.io.context.WriteContext)

Example 3 with WriteContext

use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.

the class TestDeclareReceiptApi method testNameOnly.

@Test
public void testNameOnly() {
    DeclareExtensionApi.CommitForm commitForm = new DeclareExtensionApi.CommitForm();
    commitForm.setName("testName");
    WriteContext context = new WriteContext(requestId, ownerId, operatorId);
    DeclareExtensionApi.CommitReceipt response = null;
    try {
        response = declareExtensionApi.commit(context, commitForm);
    } catch (Exception e) {
        e.printStackTrace();
    }
    Assert.assertNull(response);
}
Also used : WriteContext(one.kii.summer.io.context.WriteContext) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 4 with WriteContext

use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.

the class TestDeclareReceiptApi method testGroupOnly.

@Test
public void testGroupOnly() {
    DeclareExtensionApi.CommitForm commitForm = new DeclareExtensionApi.CommitForm();
    commitForm.setGroup("testGroup");
    WriteContext context = new WriteContext(requestId, ownerId, operatorId);
    DeclareExtensionApi.CommitReceipt response = null;
    try {
        response = declareExtensionApi.commit(context, commitForm);
    } catch (Exception e) {
        e.printStackTrace();
    }
    Assert.assertNull(response);
}
Also used : WriteContext(one.kii.summer.io.context.WriteContext) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with WriteContext

use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.

the class TestPublishModelApi method test.

@Test
public void test() {
    PublishModelApi.Form form = new PublishModelApi.Form();
    form.setVersion(version);
    form.setProviderId(providerId);
    form.setExtId(extId);
    modelPublicationMapper.deletePublicationByProviderIdExtIdPubVersion(providerId, extId, "SNAPSHOT", version);
    WriteContext context = new WriteContext(requestId, ownerId, operatorId);
    PublishModelApi.Receipt receipt = null;
    try {
        receipt = publishModelApi.commit(context, form);
    } catch (Exception e) {
        e.printStackTrace();
    }
    Assert.assertNotNull(receipt);
    Assert.assertEquals(version, receipt.getVersion());
    Assert.assertEquals(ownerId, receipt.getOwnerId());
    Assert.assertEquals(providerId, receipt.getProviderId());
}
Also used : PublishModelApi(one.kii.kiimate.model.core.api.PublishModelApi) WriteContext(one.kii.summer.io.context.WriteContext) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

WriteContext (one.kii.summer.io.context.WriteContext)12 Test (org.junit.Test)8 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 PublishModelApi (one.kii.kiimate.model.core.api.PublishModelApi)1 RevokeIntensionApi (one.kii.kiimate.model.core.api.RevokeIntensionApi)1 SubscribeModelsApi (one.kii.kiimate.model.core.api.SubscribeModelsApi)1 ExtensionDai (one.kii.kiimate.model.core.dai.ExtensionDai)1 AnSubscribeModelExtractor (one.kii.kiimate.model.core.fui.AnSubscribeModelExtractor)1 RefreshStatusApi (one.kii.kiimate.status.core.api.RefreshStatusApi)1 Conflict (one.kii.summer.io.exception.Conflict)1 Panic (one.kii.summer.io.exception.Panic)1