@Test
public void testValidateEntity() {

    int code = 400;
    String en ="entityOne";
    Entity entity = new Entity();
    String nonmatchName ="entityTwo";
    
    // tests the condition: if (!en.equals(entity.getName()))...
    try {
        entity.setName(nonmatchName);
        
        zms.validateEntity(en, entity);
        fail("requesterror not thrown.");
    } catch (ResourceException e) {
        assertEquals(e.getCode(), code);
    }
    
    // tests the condition: if (entity.getValue() == null)...
    try {
        entity.setName(en);
        
        zms.validateEntity(en, entity);
        fail("requesterror not thrown.");
    } catch (ResourceException e) {
        assertEquals(e.getCode(), code);
    }
}