EntityTagResourceProvider extends BaseResourceProvider implements ResourceProvider { @Override public void deleteResourceById(Request request) throws ResourceNotFoundException, InvalidPayloadException { typeSystem.deleteTag(request.<String>getProperty("id"), request.<String>getProperty("name")); } EntityTagResourceProvider(AtlasTypeSystem typeSystem); @Override Result getResourceById(Request request); @Override Result getResources(Request request); @Override void createResource(Request request); @Override Collection<String> createResources(Request request); @Override void deleteResourceById(Request request);  }
@Test public void testDeleteResourceById() throws Exception { AtlasTypeSystem typeSystem = createStrictMock(AtlasTypeSystem.class); typeSystem.deleteTag("1", "taxonomyName.termName"); replay(typeSystem); Map<String, Object> requestProperties = new HashMap<>(); requestProperties.put("name", "taxonomyName.termName"); requestProperties.put("id", "1"); Request userRequest = new InstanceRequest(requestProperties); EntityTagResourceProvider provider = new EntityTagResourceProvider(typeSystem); provider.setQueryFactory(null); provider.deleteResourceById(userRequest); verify(typeSystem); }