### Question:
UmaPolicyResource implements CollectionResourceProvider { @Override public Promise<ActionResponse, ResourceException> actionInstance(Context context, String resourceId, ActionRequest request) { return new NotSupportedException().asPromise(); } @Inject  UmaPolicyResource(UmaPolicyService umaPolicyService); @Override Promise<ResourceResponse, ResourceException> createInstance(Context context, CreateRequest request); @Override Promise<ResourceResponse, ResourceException> readInstance(Context context, final String resourceId,
            ReadRequest request); @Override Promise<ResourceResponse, ResourceException> updateInstance(Context context, String resourceId,
            UpdateRequest request); @Override Promise<ResourceResponse, ResourceException> deleteInstance(Context context, final String resourceId,
            DeleteRequest request); @Override Promise<ResourceResponse, ResourceException> patchInstance(Context context, String resourceId,
            PatchRequest request); @Override Promise<ActionResponse, ResourceException> actionCollection(Context context, ActionRequest request); @Override Promise<ActionResponse, ResourceException> actionInstance(Context context, String resourceId,
            ActionRequest request); @Override Promise<QueryResponse, ResourceException> queryCollection(Context context, final QueryRequest request,
            final QueryResourceHandler handler);  }### Answer:
@Test @SuppressWarnings("unchecked") public void shouldThrowNotSupportedExceptionForActionInstance() { Context context = mock(Context.class); ActionRequest request = Requests.newActionRequest("/policies", "ACTION_ID"); Promise<ActionResponse, ResourceException> result = policyResource.actionInstance(context, "RESOURCE_SET_ID", request); assertThat(result).failedWithException().isInstanceOf(NotSupportedException.class); }