@Test @RunWithCustomExecutor public void givenTestValidateFileXSD() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(TENANT_ID); File fileProfileXsd = PropertiesUtils.getResourceFile("profile_ok.xsd"); ProfileModel modelMock = mock(ProfileModel.class); when(modelMock.getFormat()).thenReturn(ProfileFormat.XSD); final VitamError vitamError = new VitamError(""); boolean isValide = profileManager.validateProfileFile(modelMock, fileProfileXsd, vitamError); assertThat(isValide).isTrue(); }
public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception { if (null == profileModel) { error.addToErrors(getVitamError("Profile metadata not found for the corresponding inputstream")); return false; } switch (profileModel.getFormat()) { case XSD: return validateXSD(file, error); case RNG: return validateRNG(file, error); default: error.addToErrors(getVitamError("Profile format not supported")); return false; } }
ProfileManager { public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception { if (null == profileModel) { error.addToErrors(getVitamError("Profile metadata not found for the corresponding inputstream")); return false; } switch (profileModel.getFormat()) { case XSD: return validateXSD(file, error); case RNG: return validateRNG(file, error); default: error.addToErrors(getVitamError("Profile format not supported")); return false; } } }
ProfileManager { public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception { if (null == profileModel) { error.addToErrors(getVitamError("Profile metadata not found for the corresponding inputstream")); return false; } switch (profileModel.getFormat()) { case XSD: return validateXSD(file, error); case RNG: return validateRNG(file, error); default: error.addToErrors(getVitamError("Profile format not supported")); return false; } } ProfileManager(LogbookOperationsClient logbookClient, GUID eip); }
ProfileManager { public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception { if (null == profileModel) { error.addToErrors(getVitamError("Profile metadata not found for the corresponding inputstream")); return false; } switch (profileModel.getFormat()) { case XSD: return validateXSD(file, error); case RNG: return validateRNG(file, error); default: error.addToErrors(getVitamError("Profile format not supported")); return false; } } ProfileManager(LogbookOperationsClient logbookClient, GUID eip); boolean validateProfile(ProfileModel profile,
        VitamError error); boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error); boolean validateXSD(File file, VitamError error); boolean validateRNG(File file, VitamError error); void logValidationError(String eventType, String objectId, String errorsDetails,
        String KOEventType); void logFatalError(String eventType, String objectId, String errorsDetails); void logStarted(String eventType, String objectId); void logSuccess(String eventType, String objectId, String message); ProfileValidator createMandatoryParamsValidator(); ProfileValidator createWrongFieldFormatValidator(); ProfileValidator checkEmptyIdentifierSlaveModeValidator(); ProfileValidator createCheckDuplicateInDatabaseValidator(); }
ProfileManager { public boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error) throws Exception { if (null == profileModel) { error.addToErrors(getVitamError("Profile metadata not found for the corresponding inputstream")); return false; } switch (profileModel.getFormat()) { case XSD: return validateXSD(file, error); case RNG: return validateRNG(file, error); default: error.addToErrors(getVitamError("Profile format not supported")); return false; } } ProfileManager(LogbookOperationsClient logbookClient, GUID eip); boolean validateProfile(ProfileModel profile,
        VitamError error); boolean validateProfileFile(ProfileModel profileModel, File file, VitamError error); boolean validateXSD(File file, VitamError error); boolean validateRNG(File file, VitamError error); void logValidationError(String eventType, String objectId, String errorsDetails,
        String KOEventType); void logFatalError(String eventType, String objectId, String errorsDetails); void logStarted(String eventType, String objectId); void logSuccess(String eventType, String objectId, String message); ProfileValidator createMandatoryParamsValidator(); ProfileValidator createWrongFieldFormatValidator(); ProfileValidator checkEmptyIdentifierSlaveModeValidator(); ProfileValidator createCheckDuplicateInDatabaseValidator(); static final String EMPTY_REQUIRED_FIELD; static final String WRONG_FIELD_FORMAT; static final String DUPLICATE_IN_DATABASE; static final String PROFILE_NOT_FOUND_IN_DATABASE; static final String IMPORT_KO; static final String UPDATE_PROFILE_NOT_FOUND; static final String UPDATE_VALUE_NOT_IN_ENUM; static final String UPDATE_DUPLICATE_IN_DATABASE; static final String UPDATE_KO; }