-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement/wip java11 #19
base: master
Are you sure you want to change the base?
Conversation
Ottimo lavoro @FaberNa ne parliamo su #spid-spring di developers italia se vi va |
In questa PR c'è sicuramente da portare il plugin di maven per abilitare i test in build, poi per java 11 è tutto da decidere |
softly.assertThat(resultElement.getAttributes().getNamedItem("IsPassive")).isNull(); | ||
softly.assertThat(resultElement.getAttributes().getNamedItem("IsPassive")).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FaberNa mi pareva di aver capito (anche da questa guida qui) che l'attributo IsPassive non dovesse essere presente.
@peppelinux tu sei sicuramente più informato.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marque88 è corretto
consiglio di controllare metadata e authnrequest con spid-sp-test per stare tranquilli su eventuali anomalie da risolvere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- nell’elemento non deve essere presente l’attributo IsPassive (ad indicare false come valore di default) ... in verità andrebbe aggiunto che se presente deve essere false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
un giro con spid-sp-test ci darebbe contezza sulle criticità, esempio:
Questi sono i controlli che AgID fa in fase di collaudo
|
||
@SneakyThrows | ||
@BeforeAll | ||
static void startup(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation
static void startup(){ | |
static void startup(){ |
"-----END CERTIFICATE-----"; | ||
idpKeyManager = new IdpKeyManager(entity,certificateStr); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line
softly.assertThat(credential.getEntityId()).isEqualTo("test.idp.entity"); | ||
}); | ||
} | ||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing an empty line
@Test | |
@Test |
Credential credential = idpKeyManager.getCredential(null); | ||
assertThat(credential).isNull(); | ||
} | ||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing an empty line
@Test | |
@Test |
Certificate certificate = idpKeyManager.getCertificate(null); | ||
assertThat(certificate).isNull(); | ||
} | ||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing an empty line
@Test | |
@Test |
void shouldReturnCredentialWhenKeyisNotNullAndKeyEqualEntity() { | ||
Credential credential = idpKeyManager.getCredential("test.idp.entity"); | ||
SoftAssertions.assertSoftly(softly -> { | ||
softly.assertThat(credential).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered whether this assertion could be redundant? Since if credential
will ever be null, the next assertion would fail the test anyway.
@SneakyThrows | ||
@BeforeAll | ||
static void startup(){ | ||
String entity ="test.idp.entity"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a space
String entity ="test.idp.entity"; | |
String entity = "test.idp.entity"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This string is repeated a few times throughout the tests, consider extracting it to a constant.
@polarene scusa vedo che hai corretto l'indentazione ma dentro al progetto non vedo file di style per il codice, non sarebbe il caso di aggiungere qualcosa stile check-style ? @peppelinux |
@FaberNa sì assolutamente, bisognerebbe aggiungere almeno il supporto CheckStyle con uno stile condiviso (ad es. Google Style, così da tagliare la testa al toro) e magari un file |
Oltre ad editorconfig, potremmo introdurre anche il plugin maven di Spotless, che consente di auto-formattare il codice durante la build. Supporta vari stili configurabili, incluso quello Google. Viva la piena automazione! ;) |
@peppelinux Ho aggiunto qualche test e fatto il passaggio a java 11. Inoltre ho corretto l'errore per cui i test non partivano, senza il plugin corretto con junit5 non venivano considerati ...