Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 683f67a

Browse files
Added a java test for tests that aren't legal in kotlin
1 parent 2ebdb61 commit 683f67a

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

builder-processor/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dependencies {
55

66
implementation 'com.squareup:kotlinpoet:1.0.0-RC1'
77
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
8+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
89
}

client/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ dependencies {
66
kapt project(':builder-processor')
77

88
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
9+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
910

1011
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.2.0'
1112
testCompile group: 'com.willowtreeapps.assertk', name: 'assertk', version: '0.10'
13+
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.10.0'
1214

1315
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.thinkinglogic.example;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.assertj.core.api.Assertions.catchThrowable;
6+
import static org.assertj.core.api.BDDAssertions.then;
7+
8+
public class SimpleDataClassJavaTest {
9+
10+
@Test
11+
void builderShouldRejectNullValueForRequiredFields() {
12+
// given
13+
SimpleDataClassBuilder builder = new SimpleDataClassBuilder();
14+
15+
// when
16+
Throwable exception = catchThrowable(() -> builder.notNullString(null));
17+
18+
then(exception)
19+
.isInstanceOf(IllegalArgumentException.class)
20+
.hasMessageContaining("notNullString");
21+
}
22+
}

0 commit comments

Comments
 (0)