### Question:
OzoneBlockTokenSecretManager extends
    OzoneSecretManager<OzoneBlockTokenIdentifier> { @Override public OzoneBlockTokenIdentifier createIdentifier() { throw new SecurityException("Ozone block token can't be created " + "without owner and access mode information."); } OzoneBlockTokenSecretManager(SecurityConfig conf,
      long blockTokenExpirytime, String omCertSerialId); @Override OzoneBlockTokenIdentifier createIdentifier(); OzoneBlockTokenIdentifier createIdentifier(String owner,
      String blockId, EnumSet<AccessModeProto> modes, long maxLength); Token<OzoneBlockTokenIdentifier> generateToken(String user,
      String blockId, EnumSet<AccessModeProto> modes, long maxLength); Token<OzoneBlockTokenIdentifier> generateToken(String blockId,
      EnumSet<AccessModeProto> modes, long maxLength); @Override byte[] retrievePassword(OzoneBlockTokenIdentifier identifier); @Override long renewToken(Token<OzoneBlockTokenIdentifier> token,
      String renewer); @Override OzoneBlockTokenIdentifier cancelToken(Token<OzoneBlockTokenIdentifier>
      token, String canceller); boolean validateToken(OzoneBlockTokenIdentifier identifier); boolean verifySignature(OzoneBlockTokenIdentifier identifier,
      byte[] password); @Override synchronized void start(CertificateClient client); @Override synchronized void stop();  }### Answer:
@Test public void testCreateIdentifierSuccess() throws Exception { OzoneBlockTokenIdentifier btIdentifier = secretManager.createIdentifier( "testUser", "101", EnumSet.allOf(AccessModeProto.class), 100); Assert.assertTrue(btIdentifier.getOwnerId().equals("testUser")); Assert.assertTrue(btIdentifier.getBlockId().equals("101")); Assert.assertTrue(btIdentifier.getAccessModes().equals(EnumSet .allOf(AccessModeProto.class))); Assert.assertTrue(btIdentifier.getOmCertSerialId().equals(omCertSerialId)); byte[] hash = secretManager.createPassword(btIdentifier); validateHash(hash, btIdentifier.getBytes()); }
@Test public void testCreateIdentifierFailure() throws Exception { LambdaTestUtils.intercept(SecurityException.class, "Ozone block token can't be created without owner and access mode " + "information.", () -> { secretManager.createIdentifier(); }); }