org.junit.jupiter.api.Tag.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中org.junit.jupiter.api.Tag.<init>()方法的一些代码示例,展示了Tag.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.<init>()方法的具体详情如下:
包路径:org.junit.jupiter.api.Tag
类名称:Tag
方法名:<init>

Tag.<init>介绍

暂无

代码示例

代码示例来源:origin: cloudfoundry/uaa

@Tag("oidc spec")
@Tag("uaa oidc logic")
@Nested
@DisplayName("when the user doesn't request the 'openid' scope")
@WithSpring
class WhenUserDoesntRequestOpenIdScope {
  @BeforeEach
  void setupRequest() {
    requestedScope = "uaa.admin";
  }
  @DisplayName("id token should not be returned")
  @ParameterizedTest
  @ValueSource(strings = {GRANT_TYPE_PASSWORD, GRANT_TYPE_AUTHORIZATION_CODE, GRANT_TYPE_IMPLICIT})
  public void ensureAnIdTokenIsNotReturned(String grantType) {
    AuthorizationRequest authorizationRequest = constructAuthorizationRequest(clientId, grantType, requestedScope);
    OAuth2Authentication auth2Authentication = constructUserAuthenticationFromAuthzRequest(authorizationRequest, "admin", "uaa");
    CompositeToken accessToken = (CompositeToken) tokenServices.createAccessToken(auth2Authentication);
    assertAll("id token is not returned, and a useful log message is printed",
     () -> assertThat(accessToken.getIdTokenValue(), is(nullValue())),
     () -> assertThat("Useful log message", loggingOutputStream.toString(), containsString("an ID token was requested but 'openid' is missing from the requested scopes"))
    );
  }
}

代码示例来源:origin: cloudfoundry/uaa

@Tag("https://tools.ietf.org/html/rfc7519#section-5.3")
@Test
void shouldNotAllowAnyReplicatedHeaders(@RandomValue String randomVal) {
  objectNode.put(randomVal, randomVal);
  Assertions.assertThrows(Exception.class, () ->
      JwtHeaderHelper.create(asBase64(objectNode.toString()))
  );
}

代码示例来源:origin: cloudfoundry/uaa

@Tag("https://tools.ietf.org/html/rfc7516#section-4.1.2")
@DisplayName("the enc/iv header claims are for JWE tokens.")
@Test
void shouldSerializeOnlyWithValidRequiredHeaders() {
  final CommonSigner hmac = new CommonSigner("fake-key", "HMAC", null);
  JwtHeader header = JwtHeaderHelper.create(hmac.algorithm(), hmac.keyId(), hmac.keyURL());
  assertThat(header.toString(), not(containsString("enc")));
  assertThat(header.toString(), not(containsString("iv")));
  assertThat(header.toString(), not(containsString("jwk")));
  assertThat(header.toString(), not(containsString("x5u")));
  assertThat(header.toString(), not(containsString("x5c")));
  assertThat(header.toString(), not(containsString("x5t")));
  assertThat(header.toString(), not(containsString("x5t#S256")));
  assertThat(header.toString(), not(containsString("crit")));
  // support not including `cty` if not present for back-compat
  assertThat(header.toString(), not(containsString("cty")));
}

代码示例来源:origin: cloudfoundry/uaa

@Tag("oidc spec")
@Tag("uaa oidc logic")
@DisplayName("ensureIdToken Returned when Client Has OpenId Scope and Scope=OpenId withGrantType")
@ParameterizedTest
@ValueSource(strings = {GRANT_TYPE_PASSWORD, GRANT_TYPE_AUTHORIZATION_CODE, GRANT_TYPE_IMPLICIT})
public void ensureIdTokenReturned_withGrantType(String grantType) {
  AuthorizationRequest authorizationRequest = constructAuthorizationRequest(clientId, grantType, requestedScope);
  OAuth2Authentication auth2Authentication = constructUserAuthenticationFromAuthzRequest(authorizationRequest, "admin", "uaa");
  CompositeToken accessToken = (CompositeToken) tokenServices.createAccessToken(auth2Authentication);
  assertThat(accessToken.getIdTokenValue(), is(not(nullValue())));
  JwtHelper.decode(accessToken.getIdTokenValue());
}

代码示例来源:origin: cloudfoundry/uaa

@Tag("https://tools.ietf.org/html/rfc7519#ref-JWS")
@DisplayName("JWS")
@Nested

代码示例来源:origin: cloudfoundry/uaa

@Tag("https://tools.ietf.org/html/rfc7519#section-5")
@DisplayName("JOSE Header")
@ExtendWith(RandomParametersJunitExtension.class)

代码示例来源:origin: cloudfoundry/uaa

@Tag("oidc spec")
@DisplayName("id token should contain jku header")
@Test
public void ensureJKUHeaderIsSetWhenBuildingAnIdToken() {
  AuthorizationRequest authorizationRequest = constructAuthorizationRequest(clientId, GRANT_TYPE_PASSWORD, requestedScope);
  OAuth2Authentication auth2Authentication = constructUserAuthenticationFromAuthzRequest(authorizationRequest, "admin", "uaa");
  CompositeToken accessToken = (CompositeToken) tokenServices.createAccessToken(auth2Authentication);
  Jwt jwtToken = JwtHelper.decode(accessToken.getIdTokenValue());
  assertThat(jwtToken.getHeader().getJku(), startsWith(uaaUrl));
  assertThat(jwtToken.getHeader().getJku(), is("https://uaa.some.test.domain.com:555/uaa/token_keys"));
}

代码示例来源:origin: junit-team/junit5-samples

@Tag("fast")
class FirstTest {

  @Test
  @DisplayName("My 1st JUnit 5 test! 😎")
  void myFirstTest(TestInfo testInfo) {
    Calculator calculator = new Calculator();
    assertEquals(2, calculator.add(1, 1), "1 + 1 should equal 2");
    assertEquals("My 1st JUnit 5 test! 😎", testInfo.getDisplayName(), () -> "TestInfo is injected correctly");
  }

}

代码示例来源:origin: junit-team/junit5-samples

@Test
  @Tag("slow")
  void aSlowTest() throws InterruptedException {
    Thread.sleep(1000);
  }
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.WipesFDB)
public void testMapPathKeysConflict() throws Exception {
  final int parallelism = 20;
  // use one FDB instance
  testParallelReverseDirectoryCache(parallelism, true, () -> fdb);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.WipesFDB)
public void testCacheInitConflict() throws Exception {
  final int parallelism = 20;
  // use one FDB instance
  testParallelReverseDirectoryCache(parallelism, false, () -> fdb);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void oneHundredElementsParallelRank() {
  Random r = new Random(0x5ca1ab1e);
  List<TestRecords1Proto.MySimpleRecord> records = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(100).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  rankRebuild(records, null, 5, false);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void oneHundredElementsParallelOverlapRank() {
  Random r = new Random(0xf005ba11);
  List<TestRecords1Proto.MySimpleRecord> records = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(100).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  rankRebuild(records, null, 5, true);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void addWhileBuildingParallelRank() {
  Random r = new Random(0xdeadc0de);
  List<TestRecords1Proto.MySimpleRecord> records = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(150).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  List<TestRecords1Proto.MySimpleRecord> recordsWhileBuilding = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(150).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  rankRebuild(records, recordsWhileBuilding, 5, false);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void addWhileBuildingParallelVersion() {
  Random r = new Random(0x8badf00d);
  List<TestRecords1Proto.MySimpleRecord> records = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(150).collect(Collectors.toList());
  List<TestRecords1Proto.MySimpleRecord> recordsWhileBuilding = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextLong() / 2).setNumValue2(r.nextInt(10)).build()
  ).limit(150).collect(Collectors.toList());
  versionRebuild(records, recordsWhileBuilding, 5, false);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void addSequentialWhileBuildingParallel() {
  Random r = new Random(0xba5eba11);
  List<TestRecords1Proto.MySimpleRecord> records = LongStream.range(0, 100).mapToObj( val ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(val).setNumValue2(r.nextInt(20)).build()
  ).collect(Collectors.toList());
  List<TestRecords1Proto.MySimpleRecord> recordsWhileBuilding = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextInt(100)).setNumValue2(r.nextInt(20) + 20).build()
  ).limit(100).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  valueRebuild(records, recordsWhileBuilding, 5, false);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void addSequentialWhileBuilding() {
  Random r = new Random(0xba5eba11);
  List<TestRecords1Proto.MySimpleRecord> records = LongStream.range(0, 100).mapToObj( val ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(val).setNumValue2(r.nextInt(20)).build()
  ).collect(Collectors.toList());
  List<TestRecords1Proto.MySimpleRecord> recordsWhileBuilding = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextInt(100)).setNumValue2(r.nextInt(20) + 20).build()
  ).limit(100).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  valueRebuild(records, recordsWhileBuilding);
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.Slow)
public void addSequentialWhileBuildingParallelRank() {
  Random r = new Random(0xba5eba11);
  List<TestRecords1Proto.MySimpleRecord> records = LongStream.range(0, 100).mapToObj( val ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(val).setNumValue2(r.nextInt(20)).build()
  ).collect(Collectors.toList());
  List<TestRecords1Proto.MySimpleRecord> recordsWhileBuilding = Stream.generate(() ->
      TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(r.nextInt(100)).setNumValue2(r.nextInt(20) + 20).build()
  ).limit(100).sorted(Comparator.comparingLong(TestRecords1Proto.MySimpleRecord::getRecNo)).collect(Collectors.toList());
  rankRebuild(records, recordsWhileBuilding, 5, false);
}

代码示例来源:origin: io.vertx/vertx-junit5

@Test
 @Tag("programmatic")
 void thisMustFail(Vertx vertx, VertxTestContext testContext) {
  testContext.verify(() -> {
   assertTrue(false);
  });
 }
}

代码示例来源:origin: FoundationDB/fdb-record-layer

@Test
@Tag(Tags.WipesFDB)
public void testCacheInitConflictMultipleDatabaseObjects() throws Exception {
  // this is to simulate multiple VMs
  final int parallelism = 20;
  testParallelReverseDirectoryCache(parallelism, false,
      () -> new FDBDatabase(FDBDatabaseFactory.instance(), null));
}

相关文章