Skip to content

Commit

Permalink
Register attribute to report or data flow
Browse files Browse the repository at this point in the history
  • Loading branch information
knighto82 authored Dec 3, 2024
1 parent e0d9376 commit 8af78bc
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void testCreateAttribute() {
.description("The name")
.index(0)
.key(true)
.isCriticalDataElement(true)
.varArg("source", "Source System 1")
.varArg("term", "bizterm1")
.varArg("dataType", "String")
Expand Down Expand Up @@ -92,6 +93,7 @@ public void testCreateAttributeWithCatalogOverride() {
.varArg("dataType", "String")
.varArg("sourceFieldId", "src_name")
.catalogIdentifier("foobar")
.isCriticalDataElement(true)
.build();

//When
Expand Down Expand Up @@ -124,6 +126,7 @@ public void testUpdateAttribute() {
.varArg("dataType", "String")
.varArg("sourceFieldId", "src_name")
.varArg("id", 1)
.isCriticalDataElement(true)
.build();

//When
Expand Down Expand Up @@ -156,6 +159,7 @@ public void testUpdateAttributeWithCatalogOverride() {
.varArg("sourceFieldId", "src_name")
.varArg("id", 1)
.catalogIdentifier("foobar")
.isCriticalDataElement(true)
.build();

//When
Expand Down Expand Up @@ -237,6 +241,4 @@ public void testDeleteAttributeWithCatalogOverride() {
//Then

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class Attribute extends CatalogResource {
@Expose(serialize = false, deserialize = false)
String dataset;

boolean isCriticalDataElement;

@Builder(toBuilder = true)
public Attribute(
@Builder.ObtainVia(method = "getIdentifier") String identifier,
Expand All @@ -37,14 +39,16 @@ public Attribute(
long index,
String description,
String title,
String dataset) {
String dataset,
boolean isCriticalDataElement) {
super(identifier, varArgs, apiManager, rootUrl, catalogIdentifier);
this.key = key;
this.dataType = dataType;
this.index = index;
this.description = description;
this.title = title;
this.dataset = dataset;
this.isCriticalDataElement = isCriticalDataElement;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public JsonElement serialize(Attribute src, Type typeOfSrc, JsonSerializationCon
jsonObject.add("description", context.serialize(src.getDescription()));
jsonObject.add("title", context.serialize(src.getTitle()));
jsonObject.add("identifier", context.serialize(src.getIdentifier()));
jsonObject.add("isCriticalDataElement", context.serialize(src.isCriticalDataElement()));

Map<String, Object> varArgs = src.getVarArgs();
if (varArgs != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void constructionWithBuilderCorrectlyPopulatesAllFields() {
.rootUrl("http://foobar/api/v1/")
.catalogIdentifier("foobar")
.apiManager(apiManager)
.isCriticalDataElement(true)
.build();

assertThat(a.getIdentifier(), is(equalTo("The identifier")));
Expand All @@ -42,6 +43,7 @@ void constructionWithBuilderCorrectlyPopulatesAllFields() {
assertThat(a.getRootUrl(), is(equalTo("http://foobar/api/v1/")));
assertThat(a.getCatalogIdentifier(), is(equalTo("foobar")));
assertThat(a.getApiManager(), is(equalTo(apiManager)));
assertThat(a.isCriticalDataElement(), is(equalTo(true)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"index": 0,
"description": "The alternate",
"title": "Alternate",
"identifier": "alternate"
"identifier": "alternate",
"isCriticalDataElement": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "The name",
"title": "Name",
"identifier": "name",
"isCriticalDataElement": true,
"term": "bizterm1",
"source": "Source System 1",
"sourceFieldId": "src_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"term": "bizterm1",
"source": "Source System 1",
"id": 1,
"sourceFieldId": "src_name"
"sourceFieldId": "src_name",
"isCriticalDataElement": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"index": 0,
"isDatasetKey": true,
"sourceFieldId": "src_name",
"title": "Name"
"title": "Name",
"isCriticalDataElement": true
},
{
"id": 2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"isDatasetKey":true,"dataType":"String","index":0,"description":"The name","title":"Name","identifier":"name"}
{"isDatasetKey":true,"dataType":"String","index":0,"description":"The name","title":"Name","identifier":"name","isCriticalDataElement":false}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"isDatasetKey":true,"dataType":"String","index":0,"description":"The name","title":"Name","identifier":"name","term":"bizterm1","id":1.0,"source":"Source System 1","sourceFieldId":"src_name"}
{"isDatasetKey":true,"dataType":"String","index":0,"description":"The name","title":"Name","identifier":"name","isCriticalDataElement":false,"term":"bizterm1","id":1.0,"source":"Source System 1","sourceFieldId":"src_name"}

0 comments on commit 8af78bc

Please sign in to comment.