Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

FaberNa
Copy link

@FaberNa FaberNa commented Jul 25, 2021

@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 ...

@peppelinux peppelinux requested a review from marque88 July 25, 2021 20:25
@peppelinux
Copy link
Member

peppelinux commented Jul 25, 2021

Ottimo lavoro @FaberNa
attendo la revisione di @marque88 prima di unire in master branch. Sopratutto, in seguito a questi contributi di adeguamento e revamping generale dovremmo iniziare a capire il potenziale del nostro gruppo e la roadmap che vorremmo dispiegare per questo progetto.

ne parliamo su #spid-spring di developers italia se vi va

@FaberNa
Copy link
Author

FaberNa commented Jul 26, 2021

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();
Copy link
Collaborator

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.

Copy link
Member

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

Copy link
Author

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

Copy link
Member

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:

https://github.com/italia/spid-sp-test/blob/8b8dc56884cfcdb2a218e975a4738318ef87f408/src/spid_sp_test/authn_request.py#L523

Questi sono i controlli che AgID fa in fase di collaudo

@marque88 marque88 mentioned this pull request Jul 26, 2021

@SneakyThrows
@BeforeAll
static void startup(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect indentation

Suggested change
static void startup(){
static void startup(){

"-----END CERTIFICATE-----";
idpKeyManager = new IdpKeyManager(entity,certificateStr);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line

Suggested change

softly.assertThat(credential.getEntityId()).isEqualTo("test.idp.entity");
});
}
@Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an empty line

Suggested change
@Test
@Test

Credential credential = idpKeyManager.getCredential(null);
assertThat(credential).isNull();
}
@Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an empty line

Suggested change
@Test
@Test

Certificate certificate = idpKeyManager.getCertificate(null);
assertThat(certificate).isNull();
}
@Test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an empty line

Suggested change
@Test
@Test

void shouldReturnCredentialWhenKeyisNotNullAndKeyEqualEntity() {
Credential credential = idpKeyManager.getCredential("test.idp.entity");
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(credential).isNotNull();

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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a space

Suggested change
String entity ="test.idp.entity";
String entity = "test.idp.entity";

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.

@FaberNa
Copy link
Author

FaberNa commented Jul 29, 2021

@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

@polarene
Copy link

polarene commented Aug 2, 2021

@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 .editorconfig per permettere a chiunque di configurare il proprio editor per formattare correttamente il codice.
Nonostante manchi lo stile ufficiale, ho commentato principalmente i punti che presentavano un'indentazione sbagliata rispetto alle righe intorno.
Ciò detto, farei volentieri queste aggiunte appena ho un attimo di tempo disponibile.

@polarene
Copy link

polarene commented Aug 2, 2021

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! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants