Esempio n. 1
0
  @Test
  @Transactional
  public void createOs_type() throws Exception {
    int databaseSizeBeforeCreate = os_typeRepository.findAll().size();

    // Create the Os_type

    restOs_typeMockMvc
        .perform(
            post("/api/os_types")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(os_type)))
        .andExpect(status().isCreated());

    // Validate the Os_type in the database
    List<Os_type> os_types = os_typeRepository.findAll();
    assertThat(os_types).hasSize(databaseSizeBeforeCreate + 1);
    Os_type testOs_type = os_types.get(os_types.size() - 1);
    assertThat(testOs_type.getOs_type_name()).isEqualTo(DEFAULT_OS_TYPE_NAME);
    assertThat(testOs_type.getDescription()).isEqualTo(DEFAULT_DESCRIPTION);
    assertThat(testOs_type.getStatus_id()).isEqualTo(DEFAULT_STATUS_ID);
    assertThat(testOs_type.getCreated_by()).isEqualTo(DEFAULT_CREATED_BY);
    assertThat(testOs_type.getCreated_date()).isEqualTo(DEFAULT_CREATED_DATE);
    assertThat(testOs_type.getModified_by()).isEqualTo(DEFAULT_MODIFIED_BY);
    assertThat(testOs_type.getModified_date()).isEqualTo(DEFAULT_MODIFIED_DATE);
  }
Esempio n. 2
0
  @Test
  @Transactional
  public void getOs_type() throws Exception {
    // Initialize the database
    os_typeRepository.saveAndFlush(os_type);

    // Get the os_type
    restOs_typeMockMvc
        .perform(get("/api/os_types/{id}", os_type.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(os_type.getId().intValue()))
        .andExpect(jsonPath("$.os_type_name").value(DEFAULT_OS_TYPE_NAME.toString()))
        .andExpect(jsonPath("$.description").value(DEFAULT_DESCRIPTION.toString()))
        .andExpect(jsonPath("$.status_id").value(DEFAULT_STATUS_ID))
        .andExpect(jsonPath("$.created_by").value(DEFAULT_CREATED_BY.toString()))
        .andExpect(jsonPath("$.created_date").value(DEFAULT_CREATED_DATE.toString()))
        .andExpect(jsonPath("$.modified_by").value(DEFAULT_MODIFIED_BY.toString()))
        .andExpect(jsonPath("$.modified_date").value(DEFAULT_MODIFIED_DATE.toString()));
  }
Esempio n. 3
0
 @Before
 public void initTest() {
   os_type = new Os_type();
   os_type.setOs_type_name(DEFAULT_OS_TYPE_NAME);
   os_type.setDescription(DEFAULT_DESCRIPTION);
   os_type.setStatus_id(DEFAULT_STATUS_ID);
   os_type.setCreated_by(DEFAULT_CREATED_BY);
   os_type.setCreated_date(DEFAULT_CREATED_DATE);
   os_type.setModified_by(DEFAULT_MODIFIED_BY);
   os_type.setModified_date(DEFAULT_MODIFIED_DATE);
 }
Esempio n. 4
0
  @Test
  @Transactional
  public void deleteOs_type() throws Exception {
    // Initialize the database
    os_typeRepository.saveAndFlush(os_type);

    int databaseSizeBeforeDelete = os_typeRepository.findAll().size();

    // Get the os_type
    restOs_typeMockMvc
        .perform(
            delete("/api/os_types/{id}", os_type.getId()).accept(TestUtil.APPLICATION_JSON_UTF8))
        .andExpect(status().isOk());

    // Validate the database is empty
    List<Os_type> os_types = os_typeRepository.findAll();
    assertThat(os_types).hasSize(databaseSizeBeforeDelete - 1);
  }
Esempio n. 5
0
  @Test
  @Transactional
  public void checkModified_dateIsRequired() throws Exception {
    int databaseSizeBeforeTest = os_typeRepository.findAll().size();
    // set the field null
    os_type.setModified_date(null);

    // Create the Os_type, which fails.

    restOs_typeMockMvc
        .perform(
            post("/api/os_types")
                .contentType(TestUtil.APPLICATION_JSON_UTF8)
                .content(TestUtil.convertObjectToJsonBytes(os_type)))
        .andExpect(status().isBadRequest());

    List<Os_type> os_types = os_typeRepository.findAll();
    assertThat(os_types).hasSize(databaseSizeBeforeTest);
  }