• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TestTemplate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.junit.jupiter.api.TestTemplate的典型用法代码示例。如果您正苦于以下问题:Java TestTemplate类的具体用法?Java TestTemplate怎么用?Java TestTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestTemplate类属于org.junit.jupiter.api包,在下文中一共展示了TestTemplate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDeleteMonitoringCheck

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleMonitoring#deleteMonitoringCheck(int)}.
 */
@TestTemplate
void testDeleteMonitoringCheck(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(delete(urlPathEqualTo("/00000000000000000000000000000000/v1.0/monitoring/1234")).willReturn
            (aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/monitoring/testDeleteMonitoringCheck.json")));

    Response<Boolean> response = api.monitoring().deleteMonitoringCheck(1234);
    List<Message> messages = response.getMessages();
    Message message = messages.get(0);

    boolean result = response.getResult();

    assertEquals("Der Monitoring-Check Test(M1234) wird geloescht", message.getMessageText());
    assertEquals(MessageType.SUCCESS, message.getType());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:23,代码来源:ModuleMonitoringTest.java


示例2: testGetStatus

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleMonitoring#getStatus(int)}.
 */
@TestTemplate
void testGetStatus(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/monitoring/1234/status"))
            .willReturn(aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/monitoring/testGetStatus.json")));

    Response<Map<String, MonitoringStatus>> response = api.monitoring().getStatus(1234);
    List<Message> messages = response.getMessages();
    MonitoringStatus result = response.getResult().get("1234");

    assertTrue(messages.isEmpty());

    assertEquals(0, result.getCode());
    assertEquals("OK - 123.45.67.89: rta 0.313ms, lost 0%", result.getResponse());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:21,代码来源:ModuleMonitoringTest.java


示例3: testGetStatuses

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleMonitoring#getStatuses(String)}.
 */
@TestTemplate
void testGetStatuses(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/monitoring/123.45.67.89/status"))
            .willReturn(aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/monitoring/testGetStatuses.json")));

    Response<Map<String, MonitoringStatus>> response = api.monitoring().getStatuses("123.45.67.89");
    List<Message> messages = response.getMessages();
    Map<String, MonitoringStatus> result = response.getResult();

    MonitoringStatus monitoringStatus1 = result.get("1234");
    MonitoringStatus monitoringStatus2 = result.get("5678");

    assertTrue(messages.isEmpty());

    assertEquals(0, monitoringStatus1.getCode());
    assertEquals("OK - 123.45.67.89: rta 0.313ms, lost 0%", monitoringStatus1.getResponse());

    assertEquals(0, monitoringStatus2.getCode());
    assertEquals("HTTP OK: Status line output matched &quot;200&quot; " + "-3827 bytes in 0.003 second response "
            + "time", monitoringStatus2
            .getResponse());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:29,代码来源:ModuleMonitoringTest.java


示例4: testCreatePeriodicalBackups

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#createPeriodicalBackups(int, int, int)}.
 */
@TestTemplate
void testCreatePeriodicalBackups(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = post(urlPathEqualTo("/00000000000000000000000000000000/v1.0/backups/12345"));
    StringValuePattern body = equalToJson("{\"dayid\": 0, \"timeid\": 1}", false, false);
    wireMock.stubFor(builder.withRequestBody(body)
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/backups/testCreatePeriodicalBackups.json")));

    Response<BackupConfig> response = api.backups().createPeriodicalBackups(12345, 0, 1);
    List<Message> messages = response.getMessages();
    BackupConfig backup = response.getResult();

    assertTrue(messages.isEmpty());

    assertEquals(0, backup.getDayid());
    assertEquals(1, backup.getTimeid());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:22,代码来源:ModuleBackupsTest.java


示例5: testUpdatePeriodicalBackups

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#updatePeriodicalBackups(int, int, int)}.
 */
@TestTemplate
void testUpdatePeriodicalBackups(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = put(urlPathEqualTo("/00000000000000000000000000000000/v1.0/backups/12345"));
    StringValuePattern body = equalToJson("{\"dayid\": 0, \"timeid\": 1}", false, false);
    wireMock.stubFor(builder.withRequestBody(body)
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/backups/testUpdatePeriodicalBackups.json")));

    Response<BackupConfig> response = api.backups().updatePeriodicalBackups(12345, 0, 1);
    List<Message> messages = response.getMessages();
    BackupConfig backup = response.getResult();

    assertTrue(messages.isEmpty());

    assertEquals(0, backup.getDayid());
    assertEquals(1, backup.getTimeid());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:22,代码来源:ModuleBackupsTest.java


示例6: testDeletePeriodicalBackups

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#deletePeriodicalBackups(int)}.
 */
@TestTemplate
void testDeletePeriodicalBackups(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = delete(urlPathEqualTo("/00000000000000000000000000000000/v1.0/backups/12345"));
    wireMock.stubFor(builder.willReturn(aResponse().withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/backups/testDeletePeriodicalBackups.json")));

    Response<Boolean> response = api.backups().deletePeriodicalBackups(12345);
    List<Message> messages = response.getMessages();
    Boolean result = response.getResult();

    assertTrue(messages.isEmpty());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:19,代码来源:ModuleBackupsTest.java


示例7: testCreateManualBackup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#createManualBackup(int)}.
 */
@TestTemplate
void testCreateManualBackup(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = post(urlPathEqualTo("/00000000000000000000000000000000/v1.0/backups/12345/manual"));
    StringValuePattern body = equalToJson("{}", false, false);
    wireMock.stubFor(builder.withRequestBody(body)
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/backups/testCreateManualBackups.json")));

    Response<Boolean> response = api.backups().createManualBackup(12345);
    List<Message> messages = response.getMessages();
    Boolean result = response.getResult();

    assertTrue(messages.isEmpty());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:21,代码来源:ModuleBackupsTest.java


示例8: testDeleteBackup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#deleteBackup(int, String, String)}.
 */
@TestTemplate
void testDeleteBackup(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = delete(urlPathEqualTo
            ("/00000000000000000000000000000000/v1.0/backups/12345/daily/12345ACDEF"));
    wireMock.stubFor(builder.willReturn(aResponse().withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/backups/testDeleteBackup.json")));

    Response<Boolean> response = api.backups().deleteBackup(12345, "daily", "12345ACDEF");
    List<Message> messages = response.getMessages();
    Boolean result = response.getResult();

    assertTrue(messages.isEmpty());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:20,代码来源:ModuleBackupsTest.java


示例9: testRestoreBackup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleBackups#restoreBackup(int, String, String)}.
 */
@TestTemplate
void testRestoreBackup(WireMockServer wireMock, JiffyBoxApi api) {
    MappingBuilder builder = post(urlPathEqualTo
            ("/00000000000000000000000000000000/v1.0/backups/12345/daily/12345ACDEF"));
    StringValuePattern body = equalToJson("{}", false, false);
    wireMock.stubFor(builder.withRequestBody(body)
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/backups/testRestoreBackup.json")));

    Response<Boolean> response = api.backups().restoreBackup(12345, "daily", "12345ACDEF");
    List<Message> messages = response.getMessages();
    Boolean result = response.getResult();

    assertTrue(messages.isEmpty());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:22,代码来源:ModuleBackupsTest.java


示例10: testGetPlan

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModulePlans#getPlan(int)}.
 */
@TestTemplate
void testGetPlan(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/plans/45")).willReturn(aResponse
            ().withHeaders(WireMockHelper
            .headers()).withStatus(200).withBodyFile("modules/plans/testGetPlan.json")));

    Response<Plan> response = api.plans().getPlan(45);
    List<Message> messages = response.getMessages();
    Plan result = response.getResult();

    assertTrue(messages.isEmpty());

    assertEquals(2, result.getCpus());
    assertEquals(204800, result.getDiskSizeInMB());
    assertEquals(45, result.getId());
    assertEquals("CloudLevel 2", result.getName());
    assertEquals(19.99, result.getPriceCap(), 0.001);
    assertEquals(0.03, result.getPricePerHour(), 0.001);
    assertEquals(0.01, result.getPricePerHourFrozen(), 0.001);
    assertEquals(4096, result.getRamInMB());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:25,代码来源:ModulePlansTest.java


示例11: testGetPlan1

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModulePlans#getPlan(String)}.
 */
@TestTemplate
void testGetPlan1(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/plans/CloudLevel%202"))
            .willReturn(aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/plans/testGetPlan1.json")));

    Response<Plan> response = api.plans().getPlan("CloudLevel 2");
    List<Message> messages = response.getMessages();
    Plan result = response.getResult();

    assertTrue(messages.isEmpty());

    assertEquals(2, result.getCpus());
    assertEquals(204800, result.getDiskSizeInMB());
    assertEquals(45, result.getId());
    assertEquals("CloudLevel 2", result.getName());
    assertEquals(19.99, result.getPriceCap(), 0.001);
    assertEquals(0.03, result.getPricePerHour(), 0.001);
    assertEquals(0.01, result.getPricePerHourFrozen(), 0.001);
    assertEquals(4096, result.getRamInMB());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:27,代码来源:ModulePlansTest.java


示例12: testGetContactGroup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleContactGroups#getContactGroup(int)}.
 */
@TestTemplate
void testGetContactGroup(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/contactGroups/123")).willReturn
            (aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/contactGroups/testGetContactGroup.json")));

    Response<ContactGroup> response = api.contactGroups().getContactGroup(123);
    List<Message> messages = response.getMessages();
    ContactGroup contactGroup = response.getResult();
    List<String> contacts = contactGroup.getContacts();

    assertTrue(messages.isEmpty());

    assertEquals(123, contactGroup.getId());
    assertEquals("TestGruppe", contactGroup.getName());
    assertEquals(ContactGroupStatus.STATUS_READY, contactGroup.getStatus());

    assertEquals("[email protected]", contacts.get(0));
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:25,代码来源:ModuleContactGroupsTest.java


示例13: testDeleteContactGroup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleContactGroups#deleteContactGroup(int)}.
 */
@TestTemplate
void testDeleteContactGroup(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(delete(urlPathEqualTo("/00000000000000000000000000000000/v1.0/contactGroups/123"))
            .willReturn(aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/contactGroups/testDeleteContactGroup.json")));

    Response<Boolean> response = api.contactGroups().deleteContactGroup(123);
    List<Message> messages = response.getMessages();
    Boolean result = response.getResult();

    assertTrue(messages.isEmpty());

    assertTrue(result);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:20,代码来源:ModuleContactGroupsTest.java


示例14: testUpdateContactGroup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleContactGroups#updateContactGroup(int, String)}.
 */
@TestTemplate
void testUpdateContactGroup(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(put(urlPathEqualTo("/00000000000000000000000000000000/v1.0/contactGroups/1234"))
            .withRequestBody(equalToJson("{\"name\" : \"Neuer Name der TestGruppe\"}", false, false))
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/contactGroups/testUpdateContactGroup.json")));

    Response<ContactGroup> response = api.contactGroups().updateContactGroup(1234, "Neuer Name der TestGruppe");
    List<Message> messages = response.getMessages();
    ContactGroup contactGroup = response.getResult();
    List<String> contacts = contactGroup.getContacts();

    assertTrue(messages.isEmpty());

    assertEquals(1234, contactGroup.getId());
    assertEquals("Neuer Name der TestGruppe", contactGroup.getName());
    assertEquals(ContactGroupStatus.STATUS_UPDATING, contactGroup.getStatus());

    assertEquals("[email protected]", contacts.get(0));
    assertEquals("[email protected]", contacts.get(1));
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:26,代码来源:ModuleContactGroupsTest.java


示例15: testUpdateContactGroup1

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleContactGroups#updateContactGroup(int, List)}
 */
@TestTemplate
void testUpdateContactGroup1(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(put(urlPathEqualTo("/00000000000000000000000000000000/v1.0/contactGroups/1234"))
            .withRequestBody(equalToJson("{\"contacts\": [\"[email protected]\"]}", false, false))
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/contactGroups/testUpdateContactGroup1.json")));

    List<String> contacts1 = new ArrayList<>();
    contacts1.add("[email protected]");

    Response<ContactGroup> response = api.contactGroups().updateContactGroup(1234, contacts1);
    List<Message> messages = response.getMessages();
    ContactGroup contactGroup = response.getResult();
    List<String> contacts2 = contactGroup.getContacts();

    assertTrue(messages.isEmpty());

    assertEquals(1234, contactGroup.getId());
    assertEquals("TestGruppe", contactGroup.getName());
    assertEquals(ContactGroupStatus.STATUS_UPDATING, contactGroup.getStatus());

    assertEquals("[email protected]", contacts2.get(0));
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:28,代码来源:ModuleContactGroupsTest.java


示例16: testDuplicateContactGroup

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleContactGroups#duplicateContactGroup(int, String)}.
 */
@TestTemplate
void testDuplicateContactGroup(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(post(urlPathEqualTo("/00000000000000000000000000000000/v1.0/contactGroups/1234"))
            .withRequestBody(equalToJson("{\"name\": \"Kopie von TestGruppe\"}", false, false))
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/contactGroups/testDuplicateContactGroup.json")));

    Response<ContactGroup> response = api.contactGroups().duplicateContactGroup(1234, "Kopie von TestGruppe");
    List<Message> messages = response.getMessages();
    ContactGroup contactGroup = response.getResult();
    List<String> contacts2 = contactGroup.getContacts();

    assertTrue(messages.isEmpty());

    assertEquals(1235, contactGroup.getId());
    assertEquals("Kopie von TestGruppe", contactGroup.getName());
    assertEquals(ContactGroupStatus.STATUS_UPDATING, contactGroup.getStatus());

    assertEquals("[email protected]", contacts2.get(0));
    assertEquals("[email protected]", contacts2.get(1));
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:26,代码来源:ModuleContactGroupsTest.java


示例17: testDeleteJiffyBox

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleJiffyBoxes#deleteJiffyBox(int)}.
 */
@TestTemplate
void testDeleteJiffyBox(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(delete(urlPathEqualTo("/00000000000000000000000000000000/v1.0/jiffyBoxes/12345")).willReturn
            (aResponse()
            .withHeaders(WireMockHelper.headers())
            .withStatus(200)
            .withBodyFile("modules/jiffyBoxes/testDeleteJiffyBox.json")));

    Response<Boolean> response = api.jiffyBoxes().deleteJiffyBox(12345);
    List<Message> messages = response.getMessages();

    assertTrue(messages.isEmpty());

    assertTrue(response.getResult());
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:19,代码来源:ModuleJiffyBoxesTest.java


示例18: testDuplicateJiffyBoxWithMetadata1

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleJiffyBoxes#duplicateJiffyBox(int, String, int, ObjectNode)}.
 */
@TestTemplate
void testDuplicateJiffyBoxWithMetadata1(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(post(urlPathEqualTo("/00000000000000000000000000000000/v1.0/jiffyBoxes/12345"))
            .withRequestBody(equalToJson("{\"name\": \"Test\", \"planid\": 10, \"metadata\":{\"createdBy\": " +
                    "\"The" + " " + "JiffyBoxTeam\", \"usedBy\": [\"Me\", \"You\", \"Everyone\"], " +
                    "\"freeForAll\":false}}"))
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/jiffyBoxes/testDuplicateJiffyBoxWithMetadata1.json")));

    ObjectNode metadata = Build.metadata().put("createdBy", "The JiffyBoxTeam");
    metadata.putArray("usedBy").add("Me").add("You").add("Everyone");
    metadata.put("freeForAll", false);

    Response<JiffyBox> response = api.jiffyBoxes().duplicateJiffyBox(12345, "Test", 10, metadata);
    testDuplicateJiffyBoxResponse(response);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:21,代码来源:ModuleJiffyBoxesTest.java


示例19: testDuplicateJiffyBoxWithMetadata2

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleJiffyBoxes#duplicateJiffyBox(int, String, String, ObjectNode)}.
 */
@TestTemplate
void testDuplicateJiffyBoxWithMetadata2(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(post(urlPathEqualTo("/00000000000000000000000000000000/v1.0/jiffyBoxes/12345"))
            .withRequestBody(equalToJson("{\"name\": \"Test\", \"planid\": \"CloudLevel 1\", " +
                    "\"metadata\":{\"createdBy\": " + "\"The JiffyBoxTeam\", \"usedBy\": [\"Me\", \"You\", " +
                    "\"Everyone\"], " + "\"freeForAll\":false}}"))
            .willReturn(aResponse().withHeaders(WireMockHelper.headers())
                    .withStatus(200)
                    .withBodyFile("modules/jiffyBoxes/testDuplicateJiffyBoxWithMetadata2.json")));

    ObjectNode metadata = Build.metadata().put("createdBy", "The JiffyBoxTeam");
    metadata.putArray("usedBy").add("Me").add("You").add("Everyone");
    metadata.put("freeForAll", false);

    Response<JiffyBox> response = api.jiffyBoxes().duplicateJiffyBox(12345, "Test", "CloudLevel 1", metadata);
    testDuplicateJiffyBoxResponse(response);
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:21,代码来源:ModuleJiffyBoxesTest.java


示例20: testGetDocs

import org.junit.jupiter.api.TestTemplate; //导入依赖的package包/类
/**
 * Test for {@link ModuleDoc#getDocs()}.
 */
@TestTemplate
void testGetDocs(WireMockServer wireMock, JiffyBoxApi api) {
    wireMock.stubFor(get(urlPathEqualTo("/00000000000000000000000000000000/v1.0/doc")).willReturn(aResponse()
            .withHeaders(WireMockHelper
            .headers()).withStatus(200).withBodyFile("modules/doc/testGetDocs.json")));

    Response<Map<String, String>> response = api.doc().getDocs();
    List<Message> messages = response.getMessages();
    assertTrue(messages.isEmpty());

    Map<String, String> docs = response.getResult();
    assertEquals("Modul zur Monitoring-Verwaltung", docs.get("Monitoring"));
    assertEquals("Modul zum Auflisten und Manipulieren von JiffyBoxen", docs.get("JiffyBoxes"));
    assertEquals("Dokumentationsmodul", docs.get("Doc"));
    assertEquals("Modul zum Auflisten von installierbaren Linux-Distributionen", docs.get("Distributions"));
    assertEquals("Modul zum Auflisten und ändern von IP-Adressen", docs.get("Ips"));
    assertEquals("Modul zum Auflisten von JiffyBox-Tarifen", docs.get("Plans"));
    assertEquals("Modul zum Auflisten und Beantragen von Backups", docs.get("Backups"));
    assertEquals("Modul zur Verwaltung von Kontaktgruppen", docs.get("ContactGroups"));
}
 
开发者ID:jschlichtholz,项目名称:jiffybox,代码行数:24,代码来源:ModuleDocTest.java



注:本文中的org.junit.jupiter.api.TestTemplate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Url类代码示例发布时间:2022-05-23
下一篇:
Java AddressingMessages类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap