ToBeSignedJwt { String getHeader(String name) { try { return header.getString(name); } catch (JSONException ex) { return null; } } private  ToBeSignedJwt(Builder builder);   }
@Test public void noType_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().build(); assertThat(token.getHeader(JwtNames.HEADER_TYPE)).isNull(); }
@Test public void setType_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().setType("JWT").build(); assertThat(token.getHeader(JwtNames.HEADER_TYPE)).isEqualTo("JWT"); }
@Test public void noContentType_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().build(); assertThat(token.getHeader(JwtNames.HEADER_CONTENT_TYPE)).isNull(); }
@Test public void setContentType_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().setContentType("foo").build(); assertThat(token.getHeader(JwtNames.HEADER_CONTENT_TYPE)).isEqualTo("foo"); }
@Test public void noAlgorithm_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().build(); assertThat(token.getHeader(JwtNames.HEADER_ALGORITHM)).isNull(); }
@Test public void noKeyId_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().build(); assertThat(token.getHeader(JwtNames.HEADER_KEY_ID)).isNull(); }
@Test public void setKeyId_success() throws Exception { ToBeSignedJwt token = new ToBeSignedJwt.Builder().setKeyId("123").build(); assertThat(token.getHeader(JwtNames.HEADER_KEY_ID)).isEqualTo("123"); }