Consensys / tessera

Tessera - Enterprise Implementation of Quorum's transaction manager
https://docs.tessera.consensys.net/
Apache License 2.0
180 stars 109 forks source link

Add Test scenarios - ReceiveRaw validations #1424

Open macfarla opened 2 years ago

macfarla commented 2 years ago

@Test public void receiveRawValidations() { assertThat(jersey.target("receiveraw").request().header("c11n-key", null).get().getStatus()) .describedAs("key header cannot be null") .isEqualTo(400);

  assertThat(jersey.target("receiveraw").request().get().getStatus()).isEqualTo(400);

  assertThat(jersey.target("receiveraw").request().header("c11n-key", "notbase64").get().getStatus())
          .describedAs("key header must be valid base64")
          .isEqualTo(400);

  String validBase64Encoded = Base64.getEncoder().encodeToString("VALIDKEY".getBytes());
  assertThat(
                  jersey.target("receiveraw")
                          .request()
                          .header("c11n-key", validBase64Encoded)
                          .header("c11n-to", "notbase64")
                          .get()
                          .getStatus())
          .describedAs("to header must be valid base64")
          .isEqualTo(400);

}