Skip to content

Commit

Permalink
[CST-12108] fix DecimalFormat issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Micheleboychuk committed Dec 6, 2023
1 parent e723809 commit 7363204
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
package org.dspace.app.rest.converter;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import javax.annotation.PostConstruct;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down Expand Up @@ -66,7 +68,8 @@ public QAEventRest convert(QAEvent modelObject, Projection projection) {
rest.setTitle(modelObject.getTitle());
rest.setTopic(modelObject.getTopic());
rest.setEventDate(modelObject.getLastUpdate());
rest.setTrust(new DecimalFormat("0.000").format(modelObject.getTrust()));
DecimalFormat decimalFormat = new DecimalFormat("0.000", new DecimalFormatSymbols(Locale.ENGLISH));
rest.setTrust(decimalFormat.format(modelObject.getTrust()));
// right now only the pending status can be found in persisted qa events
rest.setStatus(modelObject.getStatus());
return rest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ public void createQAEventByCorrectionTypeWithdrawnRequestTest() throws Exception
.andExpect(jsonPath("$.source", is(DSPACE_USERS_SOURCE)))
.andExpect(jsonPath("$.title", is(publication.getName())))
.andExpect(jsonPath("$.topic", is("REQUEST/WITHDRAWN")))
// .andExpect(jsonPath("$.trust", is("1,000")))
.andExpect(jsonPath("$.trust", is("1.000")))
.andExpect(jsonPath("$.status", is("PENDING")));

getClient(adminToken).perform(get("/api/core/items/" + publication.getID()))
Expand Down Expand Up @@ -963,7 +963,7 @@ public void createQAEventByCorrectionTypeReinstateRequestTest() throws Exception
.andExpect(jsonPath("$.source", is(DSPACE_USERS_SOURCE)))
.andExpect(jsonPath("$.title", is(publication.getName())))
.andExpect(jsonPath("$.topic", is("REQUEST/REINSTATE")))
// .andExpect(jsonPath("$.trust", is("1,000")))
.andExpect(jsonPath("$.trust", is("1.000")))
.andExpect(jsonPath("$.status", is("PENDING")));

getClient(adminToken).perform(get("/api/core/items/" + publication.getID()))
Expand Down

0 comments on commit 7363204

Please sign in to comment.