Skip to content

Commit

Permalink
Fix tests (temporary change, will be improved in a next PR
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurix committed Jul 8, 2022
1 parent 869362f commit 4cae18d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class JacksonProjectFolderDeserializer extends JsonDeserializer<String> {
@Override
public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
String text = jsonParser.getText();
if (!text.startsWith(forcedProjectFolder) || text.contains("..")) {
if (forcedProjectFolder != null && (!text.startsWith(forcedProjectFolder) || text.contains(".."))) {
throw new InvalidProjectFolderException(forcedProjectFolder);
}
return text;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/tech/jhipster/lite/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public static <T> T readFileToObject(String path, Class<T> valueType) {
try {
return mapper.readValue(stringObject, valueType);
} catch (JsonProcessingException e) {
throw new AssertionError("Can't read value");
throw new AssertionError("Can't read value", e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package tech.jhipster.lite.module.domain;

import static tech.jhipster.lite.module.domain.JHipsterModule.*;
import static tech.jhipster.lite.module.domain.properties.JHipsterModulePropertyDefinition.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tech.jhipster.lite.TestFileUtils;
Expand All @@ -20,13 +26,6 @@
import tech.jhipster.lite.module.domain.properties.JHipsterModulePropertiesDefinition;
import tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static tech.jhipster.lite.module.domain.JHipsterModule.*;
import static tech.jhipster.lite.module.domain.properties.JHipsterModulePropertyDefinition.*;

public final class JHipsterModulesFixture {

private static final Logger log = LoggerFactory.getLogger(JHipsterModulesFixture.class);
Expand Down

0 comments on commit 4cae18d

Please sign in to comment.