本文整理汇总了Java中org.onosproject.net.intent.FakeIntentManager类的典型用法代码示例。如果您正苦于以下问题:Java FakeIntentManager类的具体用法?Java FakeIntentManager怎么用?Java FakeIntentManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakeIntentManager类属于org.onosproject.net.intent包,在下文中一共展示了FakeIntentManager类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemove
import org.onosproject.net.intent.FakeIntentManager; //导入依赖的package包/类
/**
* Tests removing an intent with DELETE.
*/
@Test
public void testRemove() {
final HashSet<NetworkResource> resources = new HashSet<>();
resources.add(new MockResource(1));
resources.add(new MockResource(2));
resources.add(new MockResource(3));
final Intent intent = new MockIntent(3L, resources);
final ApplicationId appId = new DefaultApplicationId(2, "app");
IntentService fakeManager = new FakeIntentManager();
expect(mockCoreService.getAppId("app"))
.andReturn(appId).once();
replay(mockCoreService);
mockIntentService.withdraw(anyObject());
expectLastCall().andDelegateTo(fakeManager).once();
expect(mockIntentService.getIntent(Key.of(2, appId)))
.andReturn(intent)
.once();
expect(mockIntentService.getIntent(Key.of("0x2", appId)))
.andReturn(null)
.once();
mockIntentService.addListener(anyObject());
expectLastCall().andDelegateTo(fakeManager).once();
mockIntentService.removeListener(anyObject());
expectLastCall().andDelegateTo(fakeManager).once();
replay(mockIntentService);
WebTarget wt = target();
Response response = wt.path("intents/app/0x2")
.request(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN)
.delete();
assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
}