Skip to content

Commit

Permalink
ISSUES-4 improve tests (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 authored Nov 30, 2023
1 parent 0e910b8 commit 8b10d6a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void builderParameter() {
" @Inject A(@Named(\"a\") String s) {}",
" }",
"",
" @Component",
" @Component(generatePublicMockBuilder = true)",
" public interface AComponent {",
" A getA();",
"",
Expand Down Expand Up @@ -175,7 +175,12 @@ void builderParameter() {
" return new Builder_Impl(null);",
" }",
"",
" public static MockBuilder mockBuilder() {",
" return new MockBuilder();",
" }",
"",
" private static final class Builder_Impl implements TestClass.AComponent.Builder {",
" final MockBuilder mockBuilder;",
" String s;",
"",
" @Override",
Expand All @@ -190,6 +195,21 @@ void builderParameter() {
" return new TestClass_AComponent_Impl(a);",
" }",
" }",
"",
" public static final class MockBuilder {",
" private TestClass.A a;",
"",
" private MockBuilder() {",
" }",
"",
" public TestClass.AComponent.Builder build() {",
" return new Builder_Impl(this);",
" }",
"",
" public void a(TestClass.A a) {",
" this.a = a;",
" }",
" }",
"}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void providesPrimitive() {
" }",
"",
" @Component",
" interface AComponent {",
" public interface AComponent {",
" A getA();",
"",
" @Component.Factory",
Expand All @@ -86,7 +86,7 @@ void providesPrimitive() {
" return a;",
" }",
"",
" static TestClass.AComponent.Factory factory() {",
" public static TestClass.AComponent.Factory factory() {",
" return new Factory_Impl(null);",
" }",
"",
Expand All @@ -99,21 +99,21 @@ void providesPrimitive() {
" }",
" }",
"",
" static final class MockBuilder {",
" public static final class MockBuilder {",
" private int b;",
" private boolean b_isSet;",
" private TestClass.A a;",
"",
" TestClass.AComponent.Factory build() {",
" public TestClass.AComponent.Factory build() {",
" return new Factory_Impl(this);",
" }",
"",
" void b(int b) {",
" public void b(int b) {",
" this.b = b;",
" this.b_isSet = true;",
" }",
"",
" void a(TestClass.A a) {",
" public void a(TestClass.A a) {",
" this.a = a;",
" }",
" }",
Expand Down

0 comments on commit 8b10d6a

Please sign in to comment.