Skip to content

Commit

Permalink
Merge pull request #328 from somayaj/main
Browse files Browse the repository at this point in the history
reconciled the port for sonar.host to match sonar.yml
  • Loading branch information
pascalgrimaud authored Nov 10, 2021
2 parents b8a575a + 6e56829 commit 1b11aff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/docker/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ services:
jhonline-sonar:
image: sonarqube:8.2-community
ports:
- 9000:9000
- 9001:9000
- 9092:9092
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import io.github.jhipster.online.domain.YoRC;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;

public class YoRCDeserializer extends StdDeserializer<YoRC> {

Expand Down Expand Up @@ -58,6 +64,7 @@ public YoRC deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExc
String applicationType = getDefaultIfNull(node.get("applicationType"), "");
boolean enableTranslation = getDefaultIfNull(node.get("enableTranslation"), false);
String nativeLanguage = getDefaultIfNull(node.get("nativeLanguage"), "");
String creationDate = getDefaultIfNull(node.get("creationTimestamp"), Instant.now().toString());
boolean hasProtractor = false;
boolean hasGatling = false;
boolean hasCucumber = false;
Expand Down Expand Up @@ -106,7 +113,8 @@ public YoRC deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExc
.hasProtractor(hasProtractor)
.hasGatling(hasGatling)
.hasCucumber(hasCucumber)
.selectedLanguages(languages);
.selectedLanguages(languages)
.creationDate(Instant.parse(creationDate));
}

private String getDefaultIfNull(JsonNode node, String defaultValue) {
Expand Down

0 comments on commit 1b11aff

Please sign in to comment.