Add tests and increase minimum coverage to 70%
Depends on D255
Details
Run tests and check jacoco passes coverage requirements
Diff Detail
- Repository
- rLIBWFJVA WildFyre Java Libary
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
src/main/java/net/wildfyre/posts/PostData.java | ||
---|---|---|
149 | This was causing an NPE for me, in case you're wondering why. Using addAll fixed it. Don't ask. | |
419 | Putting a null image causes a server error. | |
src/test/java/net/wildfyre/posts/PostTest.java | ||
102 | We can't test this, because the server saves it and there's no Post.delete() |
src/test/java/net/wildfyre/posts/PostTest.java | ||
---|---|---|
64 | Suppose to have a console here? |
src/test/java/net/wildfyre/posts/PostTest.java | ||
---|---|---|
64 | Oops. My bad. I'll remove tomorrow |
After these it'll be OK for me
src/main/java/net/wildfyre/posts/Draft.java | ||
---|---|---|
223 | Why do you get it raw here? | |
src/main/java/net/wildfyre/posts/PostData.java | ||
112 | I believe you could use: isActive = json.getBoolean("active", true) | |
src/test/java/net/wildfyre/posts/PostTest.java | ||
72 | Replace by: data["id"] = c1.ID() |
src/main/java/net/wildfyre/posts/Draft.java | ||
---|---|---|
223 | Server returns 204 No Content | |
src/test/java/net/wildfyre/posts/PostTest.java | ||
72 | This isn't a Kotlin test. Are you sure that works in Java? Iirc it doesn't, but it's been a while. |
All resolved.
src/main/java/net/wildfyre/posts/PostData.java | ||
---|---|---|
112 | java.lang.UnsupportedOperationException: Not a boolean: null at com.eclipsesource.json.JsonValue.asBoolean(JsonValue.java:396) at com.eclipsesource.json.JsonLiteral.asBoolean(JsonLiteral.java:79) at com.eclipsesource.json.JsonObject.getBoolean(JsonObject.java:656) at net.wildfyre.posts.PostData.update(PostData.java:109) at net.wildfyre.posts.Draft.saveFirstTime(Draft.java:169) at net.wildfyre.posts.Draft.save(Draft.java:155) at net.wildfyre.posts.PostTest.createDraft(PostTest.java:96) With your code | |
src/test/java/net/wildfyre/posts/PostTest.java | ||
72 | > Task :compileTestJava FAILED /home/penn/libwf-java/src/test/java/net/wildfyre/posts/PostTest.java:72: error: incompatible types: String cannot be converted to int data["id"] = c1.ID(); ^ /home/penn/libwf-java/src/test/java/net/wildfyre/posts/PostTest.java:72: error: array required, but JsonObject found data["id"] = c1.ID(); ^ 2 errors FAILURE: Build failed with an exception. |