コード例 #1
0
  @Test
  public void shouldSave() throws Exception {
    EquipmentEnergyType type = new EquipmentEnergyType();
    type.setName("Test");

    controller.save(type);
    verify(service).save(type);
  }
コード例 #2
0
  @Test
  public void shouldGetById() throws Exception {
    EquipmentEnergyType type = new EquipmentEnergyType();
    type.setName("Test");
    when(service.getById(1L)).thenReturn(type);

    controller.getById(1L);
    verify(service).getById(1L);
  }