77import java .util .concurrent .atomic .AtomicReference ;
88
99import org .awaitility .Awaitility ;
10+ import org .junit .jupiter .api .Disabled ;
1011import org .junit .jupiter .api .Test ;
1112import org .springframework .beans .factory .annotation .Autowired ;
1213import org .springframework .beans .factory .annotation .Qualifier ;
@@ -49,19 +50,20 @@ public static void main(String[] args) {
4950 @ Qualifier ("simpleBlockingStub" )
5051 private SimpleGrpc .SimpleBlockingStub basic ;
5152
52- // @Test
53+ @ Test
5354 void contextLoads () {
5455 }
5556
56- // @Test
57+ @ Test
58+ @ Disabled ("Code is coming back PERMISSION_DENIED NOT UNAUTHENTICATED" )
5759 void unauthenticated () {
5860 assertThatExceptionOfType (StatusRuntimeException .class )
5961 .isThrownBy (() -> basic .streamHello (HelloRequest .newBuilder ().setName ("Alien" ).build ()).next ())
6062 .extracting ("status.code" )
6163 .isEqualTo (Code .UNAUTHENTICATED );
6264 }
6365
64- // @Test
66+ @ Test
6567 void anonymous () throws Exception {
6668 AtomicReference <ServerReflectionResponse > response = new AtomicReference <>();
6769 AtomicBoolean error = new AtomicBoolean ();
@@ -86,15 +88,15 @@ public void onCompleted() {
8688 Awaitility .await ().until (() -> response .get () != null || error .get ());
8789 }
8890
89- // @Test
91+ @ Test
9092 void unauthauthorized () {
9193 assertThatExceptionOfType (StatusRuntimeException .class )
9294 .isThrownBy (() -> basic .streamHello (HelloRequest .newBuilder ().setName ("Alien" ).build ()).next ())
9395 .extracting ("status.code" )
9496 .isEqualTo (Code .PERMISSION_DENIED );
9597 }
9698
97- // @Test
99+ @ Test
98100 void authenticated () {
99101 HelloReply response = basic .sayHello (HelloRequest .newBuilder ().setName ("Alien" ).build ());
100102 assertThat ("Hello ==> Alien" ).isEqualTo (response .getMessage ());
0 commit comments