@Test void testGetEventGenerationIds() { GetEventGenerationIdsResponse response = createGetEventGenerationIdsResponse(); when(grpcUmsClient.getEventGenerationIds(any(), any(), any())).thenReturn(response); UmsEventGenerationIds umsEventGenerationIds = underTest.getEventGenerationIds(ACCOUNT_ID, Optional.of(UUID.randomUUID().toString())); for (EventMapping eventMapping : EventMapping.values()) { assertEquals(eventMapping.getConverter().apply(response.getEventGenerationIds()), umsEventGenerationIds.getEventGenerationIds().get(eventMapping.getEventName())); } }
public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) { EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(INTERNAL_ACTOR_CRN, accountId, requestId) .getEventGenerationIds(); UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds(); Map<String, String> eventGenerationIdsMap = Maps.newHashMap(); for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) { if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) { eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd)); } } umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap); return umsEventGenerationIds; }
UmsEventGenerationIdsProvider { public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) { EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(INTERNAL_ACTOR_CRN, accountId, requestId) .getEventGenerationIds(); UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds(); Map<String, String> eventGenerationIdsMap = Maps.newHashMap(); for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) { if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) { eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd)); } } umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap); return umsEventGenerationIds; } }
UmsEventGenerationIdsProvider { public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) { EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(INTERNAL_ACTOR_CRN, accountId, requestId) .getEventGenerationIds(); UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds(); Map<String, String> eventGenerationIdsMap = Maps.newHashMap(); for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) { if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) { eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd)); } } umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap); return umsEventGenerationIds; }  }
UmsEventGenerationIdsProvider { public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) { EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(INTERNAL_ACTOR_CRN, accountId, requestId) .getEventGenerationIds(); UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds(); Map<String, String> eventGenerationIdsMap = Maps.newHashMap(); for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) { if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) { eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd)); } } umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap); return umsEventGenerationIds; }  UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId); }
UmsEventGenerationIdsProvider { public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) { EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(INTERNAL_ACTOR_CRN, accountId, requestId) .getEventGenerationIds(); UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds(); Map<String, String> eventGenerationIdsMap = Maps.newHashMap(); for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) { if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) { eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd)); } } umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap); return umsEventGenerationIds; }  UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId);  }