@@ -56,7 +56,7 @@ public class ParserTest {
56
56
public void setUp () {
57
57
echoFileDescriptor = EchoOuterClass .getDescriptor ();
58
58
echoService = echoFileDescriptor .getServices ().get (0 );
59
- assertEquals (echoService .getName (), "Echo" );
59
+ assertEquals ("Echo" , echoService .getName ());
60
60
}
61
61
62
62
@ Test
@@ -102,7 +102,7 @@ public void parseMethods_basic() {
102
102
Parser .parseMethods (
103
103
echoService , ECHO_PACKAGE , messageTypes , resourceNames , outputResourceNames );
104
104
105
- assertEquals (methods .size (), 8 );
105
+ assertEquals (8 , methods .size ());
106
106
107
107
// Methods should appear in the same order as in the protobuf file.
108
108
Method echoMethod = methods .get (0 );
@@ -114,17 +114,17 @@ public void parseMethods_basic() {
114
114
assertEquals (7 , methodSignatures .size ());
115
115
116
116
Method expandMethod = methods .get (1 );
117
- assertEquals (expandMethod .name (), "Expand" );
117
+ assertEquals ("Expand" , expandMethod .name ());
118
118
assertEquals (
119
- expandMethod .inputType (),
120
119
TypeNode .withReference (
121
- VaporReference .builder ().setName ("ExpandRequest" ).setPakkage (ECHO_PACKAGE ).build ()));
120
+ VaporReference .builder ().setName ("ExpandRequest" ).setPakkage (ECHO_PACKAGE ).build ()),
121
+ expandMethod .inputType ());
122
122
assertEquals (
123
- expandMethod .outputType (),
124
123
TypeNode .withReference (
125
- VaporReference .builder ().setName ("EchoResponse" ).setPakkage (ECHO_PACKAGE ).build ()));
126
- assertEquals (expandMethod .stream (), Method .Stream .SERVER );
127
- assertEquals (expandMethod .methodSignatures ().size (), 1 );
124
+ VaporReference .builder ().setName ("EchoResponse" ).setPakkage (ECHO_PACKAGE ).build ()),
125
+ expandMethod .outputType ());
126
+ assertEquals (Method .Stream .SERVER , expandMethod .stream ());
127
+ assertEquals (1 , expandMethod .methodSignatures ().size ());
128
128
assertMethodArgumentEquals (
129
129
"content" ,
130
130
TypeNode .STRING ,
@@ -137,12 +137,12 @@ public void parseMethods_basic() {
137
137
expandMethod .methodSignatures ().get (0 ).get (1 ));
138
138
139
139
Method collectMethod = methods .get (2 );
140
- assertEquals (collectMethod .name (), "Collect" );
141
- assertEquals (collectMethod . stream (), Method .Stream .CLIENT );
140
+ assertEquals ("Collect" , collectMethod .name ());
141
+ assertEquals (Method .Stream .CLIENT , collectMethod . stream () );
142
142
143
143
Method chatMethod = methods .get (3 );
144
- assertEquals (chatMethod .name (), "Chat" );
145
- assertEquals (chatMethod . stream (), Method .Stream .BIDI );
144
+ assertEquals ("Chat" , chatMethod .name ());
145
+ assertEquals (Method .Stream .BIDI , chatMethod . stream () );
146
146
}
147
147
148
148
@ Test
@@ -154,11 +154,11 @@ public void parseMethods_basicLro() {
154
154
Parser .parseMethods (
155
155
echoService , ECHO_PACKAGE , messageTypes , resourceNames , outputResourceNames );
156
156
157
- assertEquals (methods .size (), 8 );
157
+ assertEquals (8 , methods .size ());
158
158
159
159
// Methods should appear in the same order as in the protobuf file.
160
160
Method waitMethod = methods .get (6 );
161
- assertEquals (waitMethod .name (), "Wait" );
161
+ assertEquals ("Wait" , waitMethod .name ());
162
162
assertTrue (waitMethod .hasLro ());
163
163
TypeNode waitResponseType = messageTypes .get ("WaitResponse" ).type ();
164
164
TypeNode waitMetadataType = messageTypes .get ("WaitMetadata" ).type ();
0 commit comments