当前位置: 首页>>代码示例>>Java>>正文


Java Owner.setAddress方法代码示例

本文整理汇总了Java中org.springframework.samples.petclinic.model.Owner.setAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Owner.setAddress方法的具体用法?Java Owner.setAddress怎么用?Java Owner.setAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.samples.petclinic.model.Owner的用法示例。


在下文中一共展示了Owner.setAddress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldInsertOwner

import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void shouldInsertOwner() {
    Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
    int found = owners.size();

    Owner owner = new Owner();
    owner.setFirstName("Sam");
    owner.setLastName("Schultz");
    owner.setAddress("4, Evans Street");
    owner.setCity("Wollongong");
    owner.setTelephone("4444444444");
    this.clinicService.saveOwner(owner);
    assertThat(owner.getId().longValue()).isNotEqualTo(0);

    owners = this.clinicService.findOwnerByLastName("Schultz");
    assertThat(owners.size()).isEqualTo(found + 1);
}
 
开发者ID:PacktPublishing,项目名称:DevOps-for-Web-Development,代码行数:19,代码来源:AbstractClinicServiceTests.java

示例2: shouldInsertOwner

import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void shouldInsertOwner() {
    Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
    int found = owners.size();
    
    Owner owner = new Owner();
    owner.setFirstName("Sam");
    owner.setLastName("Schultz");
    owner.setAddress("4, Evans Street");
    owner.setCity("Wollongong");
    owner.setTelephone("4444444444");
    this.clinicService.saveOwner(owner);
    assertThat(owner.getId().longValue()).isNotEqualTo(0);

    owners = this.clinicService.findOwnerByLastName("Schultz");
    assertThat(owners.size()).isEqualTo(found + 1);
}
 
开发者ID:jenkinsci,项目名称:docker-workflow-plugin,代码行数:19,代码来源:AbstractClinicServiceTests.java

示例3: insertOwner

import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void insertOwner() {
    Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
    int found = owners.size();
    Owner owner = new Owner();
    owner.setFirstName("Sam");
    owner.setLastName("Schultz");
    owner.setAddress("4, Evans Street");
    owner.setCity("Wollongong");
    owner.setTelephone("4444444444");
    this.clinicService.saveOwner(owner);
    Assert.assertNotEquals("Owner Id should have been generated", owner.getId().longValue(), 0);
    owners = this.clinicService.findOwnerByLastName("Schultz");
    assertEquals("Verifying number of owners after inserting a new one.", found + 1, owners.size());
}
 
开发者ID:jptiancai,项目名称:spring-petclinic-study,代码行数:17,代码来源:AbstractClinicServiceTests.java

示例4: setup

import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Before
public void setup() {
    this.mockMvc = MockMvcBuilders.standaloneSetup(ownerController).build();

    george = new Owner();
    george.setId(TEST_OWNER_ID);
    george.setFirstName("George");
    george.setLastName("Franklin");
    george.setAddress("110 W. Liberty St.");
    george.setCity("Madison");
    george.setTelephone("6085551023");
    given(this.clinicService.findOwnerById(TEST_OWNER_ID)).willReturn(george);

}
 
开发者ID:PacktPublishing,项目名称:DevOps-for-Web-Development,代码行数:15,代码来源:OwnerControllerTests.java


注:本文中的org.springframework.samples.petclinic.model.Owner.setAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。