### Question:
CSourceSubscriptionService { public boolean unsubscribe(URI id) throws ResponseException { Subscription removedSub = this.subscriptionId2Subscription.remove(id); if (removedSub == null) { throw new ResponseException(ErrorType.NotFound); } for (EntityInfo info : removedSub.getEntities()) { if (info.getId() != null) { idBasedSubscriptions.remove(info.getId().toString(), removedSub); } else if (info.getType() != null) { typeBasedSubscriptions.remove(info.getType(), removedSub); } else if (info.getIdPattern() != null) { idPatternBasedSubscriptions.remove(info.getIdPattern(), removedSub); } } this.kafkaOps.pushToKafka(this.producerChannel.csourceSubscriptionWriteChannel(), id.toString().getBytes(), "null".getBytes()); return true; } CSourceSubscriptionService(CSourceProducerChannel producerChannel); Subscription querySubscription(URI id); URI subscribe(SubscriptionRequest subscriptionRequest); URI subscribe(SubscriptionRequest subscriptionRequest, boolean sync); boolean unsubscribe(URI id); Subscription updateSubscription(Subscription subscription); List<Subscription> getAllSubscriptions(int limit); Subscription getSubscription(URI subscriptionId); void checkSubscriptions(CSourceRegistration cSourceRegistration, TriggerReason triggerReason); @KafkaListener(topics = "${submanager.subscription.topic}", groupId = "csourcemanager") void handleInternalSub(Message<byte[]> message); boolean checkSubscriptions(CSourceRegistration prevCSourceRegistration,
			CSourceRegistration newCSourceRegistration);  }### Answer:
@Test public void unSubscribeTest() throws Exception { try { csourceSubs.subscribe(new SubscriptionRequest(subs, null)); Assert.assertTrue(csourceSubs.unsubscribe(new URI("urn:ngsi-ld:Subscription:7"))); }catch(Exception ex) { Assert.fail(); } }