diff --git a/job-service/model/src/main/java/org/verapdf/webapp/jobservice/model/entity/enums/Profile.java b/job-service/model/src/main/java/org/verapdf/webapp/jobservice/model/entity/enums/Profile.java index d701916f4..08ea3120e 100644 --- a/job-service/model/src/main/java/org/verapdf/webapp/jobservice/model/entity/enums/Profile.java +++ b/job-service/model/src/main/java/org/verapdf/webapp/jobservice/model/entity/enums/Profile.java @@ -1,14 +1,14 @@ package org.verapdf.webapp.jobservice.model.entity.enums; public enum Profile { - TAGGED_PDF("Tagged PDF"), - PDFUA_1_MACHINE("PDF/UA-1 (Machine)"), - PDFUA_2_MACHINE("PDF/UA-2 (Machine)"), - PDFUA_2_TAGGED_PDF("PDF/UA-2 + Tagged PDF"), - PDFUA_1_HUMAN("PDF/UA-1 (Human)"), - WCAG_2_1("WCAG 2.1 (Extra)"), - WCAG_2_1_COMPLETE("WCAG 2.1 (All)"), - WCAG_2_1_DEV("WCAG 2.1 (DEV)"), + TAGGED_PDF("ISO 32005"), + PDFUA_1("PDF/UA-1"), + PDFUA_2("PDF/UA-2"), + PDFUA_2_TAGGED_PDF("PDF/UA-2 & ISO 32005"), + WCAG_2_2_HUMAN("WCAG 2.2 (Human)"), + WCAG_2_2_MACHINE("WCAG 2.2 (Machine)"), + WCAG_2_2_COMPLETE("WCAG 2.2 Machine & Human (experimental)"), + WCAG_2_2_DEV("WCAG 2.2 (DEV)"), PDFA_1_A("PDF/A-1A"), PDFA_1_B("PDF/A-1B"), PDFA_2_A("PDF/A-2A"), diff --git a/job-service/server/src/main/java/org/verapdf/webapp/jobservice/server/controller/ProfileController.java b/job-service/server/src/main/java/org/verapdf/webapp/jobservice/server/controller/ProfileController.java index 87e7c38a9..537c309cb 100644 --- a/job-service/server/src/main/java/org/verapdf/webapp/jobservice/server/controller/ProfileController.java +++ b/job-service/server/src/main/java/org/verapdf/webapp/jobservice/server/controller/ProfileController.java @@ -17,11 +17,13 @@ public class ProfileController { public ProfileController() { this.profiles = new ArrayList<>(); - this.profiles.add(new ProfileDTO(Profile.WCAG_2_1_COMPLETE, true)); - this.profiles.add(new ProfileDTO(Profile.WCAG_2_1, true)); - this.profiles.add(new ProfileDTO(Profile.WCAG_2_1_DEV, true)); - this.profiles.add(new ProfileDTO(Profile.PDFUA_1_MACHINE, true)); - this.profiles.add(new ProfileDTO(Profile.PDFUA_1_HUMAN, false)); + this.profiles.add(new ProfileDTO(Profile.WCAG_2_2_COMPLETE, true)); + this.profiles.add(new ProfileDTO(Profile.WCAG_2_2_MACHINE, true)); + this.profiles.add(new ProfileDTO(Profile.WCAG_2_2_HUMAN, true)); + this.profiles.add(new ProfileDTO(Profile.WCAG_2_2_DEV, false)); + this.profiles.add(new ProfileDTO(Profile.PDFUA_1, true)); + this.profiles.add(new ProfileDTO(Profile.PDFUA_2, true)); + this.profiles.add(new ProfileDTO(Profile.PDFUA_2_TAGGED_PDF, true)); this.profiles.add(new ProfileDTO(Profile.TAGGED_PDF, true)); this.profiles.add(new ProfileDTO(Profile.PDFA_1_A, false)); this.profiles.add(new ProfileDTO(Profile.PDFA_1_B, false)); diff --git a/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/JobServiceUpdateJobTests.java b/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/JobServiceUpdateJobTests.java index a08056e0b..79449fbc4 100644 --- a/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/JobServiceUpdateJobTests.java +++ b/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/JobServiceUpdateJobTests.java @@ -52,7 +52,7 @@ public class JobServiceUpdateJobTests { public void createUpdateGetJobWithTasksTest() throws Exception { String uploadedJobId = createJobWithTasksAndReturnJobId(); - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"," + + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"," + "\"tasks\": [" + " {" + " \"fileId\":\"777bd16b-6bd5-404e-808e-5dc731c73963\"" + @@ -73,7 +73,7 @@ public void createUpdateGetJobWithTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -97,7 +97,7 @@ public void createUpdateGetJobWithTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -120,7 +120,7 @@ public void createUpdateGetJobWithTasksTest() throws Exception { public void createUpdateGetJobWithSameTasksTest() throws Exception { String uploadedJobId = createJobWithTasksAndReturnJobId(); - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"," + + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"," + "\"tasks\": [" + " {" + " \"fileId\":\"774bd16b-7ad5-354e-808e-5dc731c73963\"" + @@ -138,7 +138,7 @@ public void createUpdateGetJobWithSameTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -159,7 +159,7 @@ public void createUpdateGetJobWithSameTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -178,7 +178,7 @@ public void createUpdateGetJobWithSameTasksTest() throws Exception { public void createUpdateGetJobWithPartialTaskUpdateTest() throws Exception { String uploadedJobId = createJobWithTasksAndReturnJobId(); - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"," + + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"," + "\"tasks\": [" + " {" + " \"fileId\":\"774bd16b-7ad5-354e-808e-5dc731c73963\"" + @@ -196,7 +196,7 @@ public void createUpdateGetJobWithPartialTaskUpdateTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -216,7 +216,7 @@ public void createUpdateGetJobWithPartialTaskUpdateTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -236,7 +236,7 @@ public void createUpdateGetJobWithoutTasksTest() throws Exception { String uploadedJobId = createJobWithTasksAndReturnJobId(); //Updating job - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"}"; + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"}"; mockMvc.perform(MockMvcRequestBuilders.put("/jobs/" + uploadedJobId) .contentType(MediaType.APPLICATION_JSON) @@ -244,7 +244,7 @@ public void createUpdateGetJobWithoutTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -256,7 +256,7 @@ public void createUpdateGetJobWithoutTasksTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().json("{'id':'" + uploadedJobId + "'," + - "'profile':'WCAG_2_1'," + + "'profile':'WCAG_2_2_COMPLETE'," + "'status':'CREATED'," + "'progress':null," + "'queuePosition':null," + @@ -269,7 +269,7 @@ public void createUpdateJobWithProcessingStatusTest() throws Exception { job.setStatus(JobStatus.PROCESSING); job = jobRepository.saveAndFlush(job); - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"," + + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"," + "\"tasks\": [" + " {" + " \"fileId\":\"777bd16b-6bd5-404e-808e-5dc731c73963\"" + @@ -308,7 +308,7 @@ public void createUpdateJobWithFinishedStatusTest() throws Exception { job.setStatus(JobStatus.FINISHED); job = jobRepository.saveAndFlush(job); - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"," + + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"," + "\"tasks\": [" + " {" + " \"fileId\":\"777bd16b-6bd5-404e-808e-5dc731c73963\"" + @@ -338,7 +338,7 @@ public void createUpdateJobWithFinishedStatusTest() throws Exception { @Test public void updateJobWithoutJobInDatabaseTest() throws Exception { String id = "893ce251-4754-4d92-a6bc-69f775ab1ac6"; - String updateRequestBody = "{\"profile\": \"WCAG_2_1\"}"; + String updateRequestBody = "{\"profile\": \"WCAG_2_2_COMPLETE\"}"; //Updating job Exception resolvedException = mockMvc.perform(MockMvcRequestBuilders.put("/jobs/" + id) diff --git a/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/ProfileControllerTests.java b/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/ProfileControllerTests.java index c907ca256..da2608096 100644 --- a/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/ProfileControllerTests.java +++ b/job-service/server/src/test/java/org/verapdf/webapp/jobservice/server/controller/ProfileControllerTests.java @@ -35,23 +35,29 @@ void getProfilesTest() throws Exception { .andExpect(status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json("[" + - "{\"profileName\":\"WCAG_2_1_COMPLETE\"," + - "\"humanReadableName\":\"WCAG 2.1 (All)\"," + + "{\"profileName\":\"WCAG_2_2_COMPLETE\"," + + "\"humanReadableName\":\"WCAG 2.2 Machine & Human (experimental)\"," + + "\"enabled\":true}," + + "{\"profileName\":\"WCAG_2_2_MACHINE\"," + + "\"humanReadableName\":\"WCAG 2.2 (Machine)\"," + "\"enabled\":true}," + - "{\"profileName\":\"WCAG_2_1\"," + - "\"humanReadableName\":\"WCAG 2.1 (Extra)\"," + + "{\"profileName\":\"WCAG_2_2_HUMAN\"," + + "\"humanReadableName\":\"WCAG 2.2 (Human)\"," + "\"enabled\":true}," + - "{\"profileName\":\"WCAG_2_1_DEV\"," + - "\"humanReadableName\":\"WCAG 2.1 (DEV)\"," + + "{\"profileName\":\"WCAG_2_2_DEV\"," + + "\"humanReadableName\":\"WCAG 2.2 (DEV)\"," + + "\"enabled\":false}," + + "{\"profileName\":\"PDFUA_1\"," + + "\"humanReadableName\":\"PDF/UA-1\"," + "\"enabled\":true}," + - "{\"profileName\":\"PDFUA_1_MACHINE\"," + - "\"humanReadableName\":\"PDF/UA-1 (Machine)\"," + + "{\"profileName\":\"PDFUA_2\"," + + "\"humanReadableName\":\"PDF/UA-2\"," + + "\"enabled\":true}," + + "{\"profileName\":\"PDFUA_2_TAGGED_PDF\"," + + "\"humanReadableName\":\"PDF/UA-2 & ISO 32005\"," + "\"enabled\":true}," + - "{\"profileName\":\"PDFUA_1_HUMAN\"," + - "\"humanReadableName\":\"PDF/UA-1 (Human)\"," + - "\"enabled\":false}," + "{\"profileName\":\"TAGGED_PDF\"," + - "\"humanReadableName\":\"Tagged PDF\"," + + "\"humanReadableName\":\"ISO 32005\"," + "\"enabled\":true}," + "{\"profileName\":\"PDFA_1_A\"," + "\"humanReadableName\":\"PDF/A-1A\"," + diff --git a/worker/src/main/java/org/verapdf/webapp/worker/entity/ProfileMapper.java b/worker/src/main/java/org/verapdf/webapp/worker/entity/ProfileMapper.java index ed937cca6..cb08dd69f 100644 --- a/worker/src/main/java/org/verapdf/webapp/worker/entity/ProfileMapper.java +++ b/worker/src/main/java/org/verapdf/webapp/worker/entity/ProfileMapper.java @@ -39,13 +39,16 @@ public ProfileMapper() throws JAXBException { .getValidationProfileByFlavour(PDFAFlavour.PDFA_3_U)); // PDF/UA related profilesMap - this.profilesMap.put(Profile.WCAG_2_1_COMPLETE, + this.profilesMap.put(Profile.WCAG_2_2_COMPLETE, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( - "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-21-Complete.xml")))); - this.profilesMap.put(Profile.PDFUA_1_MACHINE, + "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-22-Complete.xml")))); + this.profilesMap.put(Profile.WCAG_2_2_MACHINE, + Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( + "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-22-Machine.xml")))); + this.profilesMap.put(Profile.PDFUA_1, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( "/profiles/veraPDF-validation-profiles/PDF_UA/PDFUA-1.xml")))); - this.profilesMap.put(Profile.PDFUA_2_MACHINE, + this.profilesMap.put(Profile.PDFUA_2, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( "/profiles/veraPDF-validation-profiles/PDF_UA/PDFUA-2.xml")))); this.profilesMap.put(Profile.PDFUA_2_TAGGED_PDF, @@ -54,12 +57,12 @@ public ProfileMapper() throws JAXBException { this.profilesMap.put(Profile.TAGGED_PDF, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( "/profiles/veraPDF-validation-profiles/PDF_UA/ISO-32005-Tagged.xml")))); - this.profilesMap.put(Profile.WCAG_2_1, + this.profilesMap.put(Profile.WCAG_2_2_HUMAN, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( - "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-21.xml")))); - this.profilesMap.put(Profile.WCAG_2_1_DEV, + "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-22.xml")))); + this.profilesMap.put(Profile.WCAG_2_2_DEV, Profiles.profileFromXml(Objects.requireNonNull(getClass().getResourceAsStream( - "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-21-Dev.xml")))); + "/profiles/veraPDF-validation-profiles/PDF_UA/WCAG-22-Dev.xml")))); } public ValidationProfile getValidationProfile(Profile profile) { diff --git a/worker/src/test/java/org/verapdf/webapp/worker/listener/ProfileMapperTests.java b/worker/src/test/java/org/verapdf/webapp/worker/listener/ProfileMapperTests.java index 07645772e..ab9e4f61e 100644 --- a/worker/src/test/java/org/verapdf/webapp/worker/listener/ProfileMapperTests.java +++ b/worker/src/test/java/org/verapdf/webapp/worker/listener/ProfileMapperTests.java @@ -27,13 +27,13 @@ public class ProfileMapperTests { private QueueListener queueListener; @ParameterizedTest - @EnumSource(value = Profile.class, names = {"PDFA_AUTO", "PDFUA_1_HUMAN"}, mode = EnumSource.Mode.EXCLUDE) + @EnumSource(value = Profile.class, names = {"PDFA_AUTO"}, mode = EnumSource.Mode.EXCLUDE) public void checkExistenceOfAllProfiles(Profile profile) { Assertions.assertNotNull(profileMapper.getValidationProfile(profile)); } @ParameterizedTest - @EnumSource(value = Profile.class, names = {"PDFA_AUTO", "PDFUA_1_HUMAN"}) + @EnumSource(value = Profile.class, names = {"PDFA_AUTO"}) public void checkMissingProfiles(Profile profile) { Assertions.assertNull(profileMapper.getValidationProfile(profile)); }