Your kit for clean Java.
We take our inspiration from Mother Nature, specifically the four elements of nature. We call this Alchemy Design.
assertThrows(() -> database.save(user))
.isInstanceOf(SQLException.class);
We aim to provide you with libraries as solid and dependable as the floor beneath your feet that you implicitly trust to not collapse. This means that our code is thoroughly tested early and often.
String randomUsername = one(alphabeticStrings());
We strive to be breezy yet inconspicuous like the air you breathe.
We believe great code helps you get the job done, without getting in the way.
checkThat(firstName, lastName, username)
.are(nonEmptyString())
.are(stringWithLengthAtLeast(1));
The best code is simple and fluid as a river flowing down a stream. It flows as you would intuitively expect.
We want you to feel the power as it flows through your hands when you write code with us.
Coffee myCoffee = http.go()
.get()
.expecting(Coffee.class)
.at("http://aroma.coffee/orders?orderNumber=99");
These Design Principles guide the code that we write. As such you will see that many of our projects use the Fluid Language Style to make writing code more expressive and much closer to English. We also want you to feel good when you write code with us. We want you to feel powerful.
Name | Features |
---|---|
Alchemy Annotations | Explicit Documentation |
Alchemy Arguments | Check your assumptions |
Alchemy Collections | Collect Yo'self |
Alchemy Generator | Generate Data |
Alchemy Test | Test your code |
Alchemy HTTP | Call REST Services |
Alchemy HTTP Mock | Test your HTTP Code |
String username = one(hexadecimalString());
int zipCode = one(integers(10_000, 99_999));
Computer computer = one(pojos(Computer.class));
//Runs the test 50 times
@Repeat(50)
@Test
public void testDatabase()
{
//Generate random data
String name = one(alphabeticStrings());
//Quickly assert error conditions
assertThrows(() -> database.save(name))
.isInstanceOf(SQLException.class);
}
public int getTotalPointsForUser(String user) throws HttpException
{
checkThat(user)
.is(notNull())
.is(nonEmptyString())
.is(stringWithLengthAtLeast(3))
.is(userInDatabase()); //Custom Assertion
//Proceed safely...
}
Device newDevice = http.go()
.post()
.body(device)
.expecting(Device.class)
.at("https://iot.io/api/devices/");
Just remember, this is only the beginning. These libraries will be continuously improved and updated.
- Java 8
- Maven
This Software, and all sub-projects, are licensed under the Apache 2.0 License