daniel-frak / dummy4j Goto Github PK
View Code? Open in Web Editor NEWAn extensible dummy/fake data generator library for Java
Home Page: https://daniel-frak.github.io/dummy4j/
License: Apache License 2.0
An extensible dummy/fake data generator library for Java
Home Page: https://daniel-frak.github.io/dummy4j/
License: Apache License 2.0
ResolvedValue::toString
DefaultExpressionResolver
dummy.book.title() returns "The Return of of Fandango"
A demo project presenting:
Will be glad to hear your opinion about this
Using the default time zone in tests may break them on different environments.
While in this instance, no errors have presented themselves yet, using a defined timezone will result in cleaner, more stable code.
We should allow all builders to be reusable by 'undoing' any methods called on them. In this case I mean that everywhere we have a withoutX
, like in CreditCardNumberBuilder
and CreditCardBuilder
(withoutFormatting
), we should also have a withFormatting
method.
Currently, unit tests for dummies only check if the returned values are not null. Moreover, the ScifiDummy::spaceship
method resolves an incorrect key.
Example application: efficient-mvp-example
After building application with the following command:
mvn clean package && java -jar -Dspring.profiles.active=dev,init target/efficient-mvp-example-0.0.1-SNAPSHOT.jar
and making the http://localhost:8080/api/init?seed=1&how-many-books=100
request I'm getting MissingLocaleException
.
The logs show:
Loading definitions from: [BOOT-INF/classes/dummy4j/en/book.yml]
instead of
Loading definitions from: [dummy4j/en/book.yml, โฆ]
Adding another condition specifically for Spring Boot projects in YamlFileLoader::isInAllowedPath
seems to fix the problem, but there must be a better way that doesn't require hardcoding:
private boolean isInAllowedPath(String resource, List<String> paths) {
boolean isInAllowedPath = false;
for (String path : paths) {
if (resource.startsWith(path) || resource.startsWith("BOOT-INF/classes/" + path)) {
isInAllowedPath = true;
break;
}
}
return isInAllowedPath;
}
Useful links:
Resource pattern filter for complete resource path #148
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.