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());
}
use of one.kii.summer.io.context.WriteContext in project kiimate by SINeWang.
the class TestSubscribeModelsApi method test.
@Test
public void test() {
SubscribeModelsApi.Form form = new SubscribeModelsApi.Form();
form.setGroup("testGroup");
form.setSubSet(pubSet);
long id = idgen.born();
AnSubscribeModelExtractor.ModelSubscription model = new AnSubscribeModelExtractor.ModelSubscription();
model.setSubscriberId(subscriberId);
model.setSubSet(pubSet);
model.setGroup(group);
model.setName(name);
model.setTree(tree);
modelSubscriptionMapper.deleteById(id);
form.setGroup(group);
form.setName(name);
WriteContext context = new WriteContext(requestId, ownerId, operatorId);
SubscribeModelsApi.Receipt receipt = null;
try {
receipt = subscribeModelsApi.commit(context, form);
} catch (Conflict conflict) {
conflict.printStackTrace();
}
modelSubscriptionMapper.deleteById(id);
}
Aggregations